@lynx-js/types 3.3.2 → 3.4.11

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 CHANGED
@@ -1,8 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
- ## 3.5.0
4
- - Add a new `flowIds` subfield to the TraceOption parameter in the Trace API to support one-to-many trace associations.
5
- - Refactor event definitions for improved IDE compatibility.
3
+ ## 3.4.11
4
+ - Fix types of `selectAll()` of `SelectorQuery`.
5
+
6
+ ## 3.4.10
7
+ - Add `animate` for `MainThread.Element`
6
8
 
7
9
  ## 3.4.9
8
10
  - Add more interface for `scroll-view`.
@@ -18,11 +20,11 @@
18
20
  - Complete the documentation for image related APIs.
19
21
 
20
22
  ## 3.4.4
21
- - Complete the documentation for text related APIs.
23
+ - Revert automatically generated cssTypes
22
24
 
23
25
  ## 3.4.3
24
26
  - Add `font-variation-settings`,`font-feature-settings` and `font-optical-sizing` CSS properties.
25
- - Add `experimental-recycle-available-item-before-layout` and `enable-dynamic-span-count` property for list.
27
+ - Add `experimental-recycle-available-item-before-layout` property for list.
26
28
 
27
29
  ## 3.4.2
28
30
  - And `lynx.fetchBundle` api defines.
@@ -41,19 +43,24 @@
41
43
 
42
44
  - Introduce <input> and <textarea>
43
45
 
44
- ## 3.3.2
45
- - SelectorQuery FieldsParams adds query attribute
46
- - Revert automatically generated cssTypes
46
+ ## 3.3.4
47
+
47
48
  - Add typing for the runtime interfaces.
48
- - Codegen longhand and shorthand properties from css_defines
49
+
50
+ ## 3.3.3
51
+
52
+ - [Infra][Types] Codegen longhand and shorthand properties from css_defines
49
53
  - Add `experimental-recycle-sticky-item` and `sticky-buffer-count` for list
50
54
  - Add `experimental-update-sticky-for-diff` for list
51
55
  - Add ReloadBundleEntry to standardize the timing of reload behavior.
56
+
57
+ ## 3.3.2
58
+
52
59
  - Add typing for MessageEvent.
53
60
 
54
61
  ## 3.3.1
55
62
 
56
- - Codegen csstype.d.ts from css_defines
63
+ - [Infra][Types] Codegen csstype.d.ts from css_defines
57
64
  - Rename `visibleCellsAfterUpdate` to `visibleItemAfterUpdate` for `list`
58
65
  - Rename `visibleCellsBeforeUpdate` to `visibleItemBeforeUpdate` for `list`
59
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/types",
3
- "version": "3.3.2",
3
+ "version": "3.4.11",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lynx",
@@ -90,6 +90,17 @@ export interface MetricActualFmpEntry extends PerformanceEntry {
90
90
  totalActualFmp: PerformanceMetric;
91
91
  }
92
92
 
93
+ /**
94
+ * @deprecated Due to the influence of long tasks on this metric, the statistical results are
95
+ * inaccurate, so this type has been deprecated.
96
+ * Since version 3.3, you will no longer receive this event.
97
+ **/
98
+ export interface MetricTtiEntry extends PerformanceEntry {
99
+ tti: PerformanceMetric;
100
+ lynxTti: PerformanceMetric;
101
+ totalTti: PerformanceMetric;
102
+ }
103
+
93
104
  export interface ReloadBundleEntry extends PipelineEntry {
94
105
  reloadBundleStart: number;
95
106
  reloadBundleEnd: number;
@@ -47,7 +47,6 @@ export interface FieldsParams {
47
47
  index?: boolean;
48
48
  class?: boolean;
49
49
  attribute?: boolean;
50
- query?:boolean;
51
50
  }
52
51
 
53
52
  export interface FieldsData {
@@ -57,12 +56,23 @@ export interface FieldsData {
57
56
  index: number;
58
57
  class: Array<string>;
59
58
  attribute: Record<string, unknown>;
60
- query:SelectorQuery;
61
59
  }
62
60
 
63
- export type PathCallback = (data: PathData, status: { data: string; code: number }) => void;
61
+ export type PathCallback = (data: PathData | null, status: { data: string; code: number }) => void;
64
62
 
65
- export interface NodesRef {
63
+ interface BaseNodesRef {
64
+ animate(animations: AnimationV2[] | AnimationV2): SelectorQuery;
65
+
66
+ playAnimation(ids: string[] | string): SelectorQuery;
67
+
68
+ pauseAnimation(ids: string[] | string): SelectorQuery;
69
+
70
+ cancelAnimation(ids: string[] | string): SelectorQuery;
71
+
72
+ setNativeProps(nativeProps: Record<string, any>): SelectorQuery;
73
+ }
74
+
75
+ export interface NodesRef extends BaseNodesRef {
66
76
  invoke(options: uiMethodOptions): SelectorQuery;
67
77
 
68
78
  path(callback: PathCallback): SelectorQuery;
@@ -72,20 +82,24 @@ export interface NodesRef {
72
82
  callback: (
73
83
  data: {
74
84
  [K in keyof Required<FieldsParams> as T[K] extends true ? K : never]: FieldsData[K];
75
- },
85
+ } | null,
76
86
  status: { data: string; code: number }
77
87
  ) => void
78
88
  ): SelectorQuery;
89
+ }
79
90
 
80
- animate(animations: AnimationV2[] | AnimationV2): SelectorQuery;
81
-
82
- playAnimation(ids: string[] | string): SelectorQuery;
83
-
84
- pauseAnimation(ids: string[] | string): SelectorQuery;
91
+ export interface MultiNodesRef extends BaseNodesRef {
92
+ path(callback: (data: PathData[], status: { data: string; code: number }) => void): SelectorQuery;
85
93
 
86
- cancelAnimation(ids: string[] | string): SelectorQuery;
87
-
88
- setNativeProps(nativeProps: Record<string, any>): SelectorQuery;
94
+ fields<T extends FieldsParams>(
95
+ fields: Required<FieldsParams> extends Record<keyof T, boolean> ? T : FieldsParams,
96
+ callback: (
97
+ data: {
98
+ [K in keyof Required<FieldsParams> as T[K] extends true ? K : never]: FieldsData[K];
99
+ }[],
100
+ status: { data: string; code: number }
101
+ ) => void
102
+ ): SelectorQuery;
89
103
  }
90
104
 
91
105
  export interface SelectorQuery {
@@ -99,7 +113,7 @@ export interface SelectorQuery {
99
113
  * Selects all nodes satisfying CSS selector.
100
114
  * @param selector CSS selector
101
115
  */
102
- selectAll(selector: string): NodesRef;
116
+ selectAll(selector: string): MultiNodesRef;
103
117
 
104
118
  /**
105
119
  * Select root node of the component.
@@ -10,19 +10,17 @@ import { ImageProps, ImageUIMethods } from './image';
10
10
  import { ListItemProps, ListProps, ListRowProps, ListUIMethods } from './list';
11
11
  import { PageProps } from './page';
12
12
  import { ScrollViewProps, ScrollViewUIMethods } from './scroll-view';
13
- import { TextProps, TextUIMethods } from './text';
13
+ import { TextProps } from './text';
14
14
  import { ViewProps } from './view';
15
15
  import { InputProps, InputUIMethods } from './input';
16
16
  import { TextAreaProps, TextAreaUIMethods } from './textarea';
17
17
 
18
-
19
18
  export interface UIMethods {
20
19
  'list': ListUIMethods;
21
20
  'scroll-view': ScrollViewUIMethods;
22
21
  'image': ImageUIMethods;
23
22
  'input': InputUIMethods;
24
23
  'textarea': TextAreaUIMethods;
25
- 'text': TextUIMethods;
26
24
  }
27
25
 
28
26
  type LynxComponentProps = ComponentProps;
@@ -11,11 +11,7 @@ import { StandardProps } from '../props';
11
11
  export interface ImageProps extends StandardProps {
12
12
  /**
13
13
  * Supports http/https/base64
14
- * @defaultValue undefined
15
- * @iOS
16
- * @Android
17
- * @Harmony
18
- * @PC
14
+ * @defaultValue ""
19
15
  * @since 0.2
20
16
  */
21
17
  src?: string;
@@ -26,12 +22,8 @@ export interface ImageProps extends StandardProps {
26
22
  * aspectFit: Scales the image while preserving aspect ratio so that the long side is fully visible
27
23
  * aspectFill: Scales the image while preserving aspect ratio, ensuring the short side fills the element
28
24
  * center: Does not scale the image; image is centered
29
- * @defaultValue 'scaleToFill'
25
+ * @defaultValue "scaleToFill"
30
26
  * @since 0.2
31
- * @iOS
32
- * @Android
33
- * @Harmony
34
- * @PC
35
27
  */
36
28
  mode?: 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'center';
37
29
 
@@ -39,93 +31,72 @@ export interface ImageProps extends StandardProps {
39
31
  * ARGB_8888: 32-bit memory per pixel, supports semi-transparent images
40
32
  * RGB_565: 16-bit memory per pixel, reduces memory usage but loses transparency
41
33
  * @defaultValue "ARGB_8888"
42
- * @Android
43
34
  * @since 1.4
44
35
  */
45
36
  'image-config'?: 'ARGB_8888' | 'RGB_565';
46
37
 
47
38
  /**
48
39
  * Placeholder image, used same as src
49
- * @iOS
50
- * @Android
51
- * @Harmony
52
- * @PC
40
+ * @defaultValue ""
53
41
  * @since 1.4
54
42
  */
55
43
  placeholder?: string;
56
44
 
57
45
  /**
58
46
  * Image blur radius
59
- * @iOS
60
- * @Android
61
- * @Harmony
62
- * @PC
47
+ * @defaultValue "3px"
63
48
  * @since 0.2
64
49
  */
65
50
  'blur-radius'?: string;
66
51
 
67
52
  /**
68
53
  * Stretchable area for 9patch images, in percentage or decimal, four values for top, right, bottom, left
69
- * @iOS
70
- * @Android
71
- * @Harmony
72
- * @PC
54
+ * @defaultValue "0.2 10% 0.3 20%"
73
55
  * @since 1.4
74
56
  */
75
57
  'cap-insets'?: string;
76
58
 
77
59
  /**
78
- * Adjust the scale of stretchable area for 9patch images
60
+ * Number of times an animated image plays
79
61
  * @defaultValue 1
80
- * @iOS
81
- * @Android
82
- * @Harmony
83
- * @PC
84
- * @since 1.4
85
- */
86
- 'cap-insets-scale'?: number;
87
-
88
- /**
89
- * Number of times an animated image plays, 0 stands for infinite
90
- * @defaultValue 0
91
- * @iOS
92
- * @Android
93
- * @Harmony
94
- * @PC
95
62
  * @since 1.4
96
63
  */
97
64
  'loop-count'?: number;
98
65
 
99
66
  /**
100
67
  * Image won't load if its size is 0, but will load if prefetch-width is set
101
- * @defaultValue "0px"
102
- * @deprecated
103
- * @iOS
104
- * @Android
68
+ * @defaultValue "100px"
105
69
  * @since 1.4
106
70
  */
107
71
  'prefetch-width'?: string;
108
72
 
109
73
  /**
110
74
  * Image won't load if its size is 0, but will load if prefetch-height is set
111
- * @defaultValue "0px"
112
- * @deprecated
113
- * @iOS
114
- * @Android
75
+ * @defaultValue "100px"
115
76
  * @since 1.4
116
77
  */
117
78
  'prefetch-height'?: string;
118
79
 
80
+ /**
81
+ * If true, URL mapping is skipped. LynxView's custom ImageInterceptor won't work
82
+ * @defaultValue false
83
+ * @since 1.5
84
+ */
85
+ 'skip-redirection'?: boolean;
86
+
87
+ /**
88
+ * Reduces the chance of OOM by downsampling large images, requires container support
89
+ * @defaultValue false
90
+ * @since iOS 2.0
91
+ */
92
+ downsampling?: boolean;
93
+
119
94
  /**
120
95
  * When set to true and the <image> element has no width or height,
121
96
  * the size of the <image> will be automatically adjusted
122
97
  * to match the image's original dimensions after the image is successfully loaded,
123
98
  * ensuring that the aspect ratio is maintained.
124
99
  * @defaultValue false
125
- * @iOS
126
- * @Android
127
- * @Harmony
128
- * @PC
129
100
  * @since 2.6
130
101
  */
131
102
  'auto-size'?: boolean;
@@ -135,10 +106,6 @@ export interface ImageProps extends StandardProps {
135
106
  * The default behavior is to clear the image resource before starting a new load.
136
107
  * This can resolve flickering issues when the image src is switched and reloaded. It is not recommended to enable this in scenarios where there is node reuse in views like lists.
137
108
  * @defaultValue false
138
- * @iOS
139
- * @Android
140
- * @Harmony
141
- * @PC
142
109
  * @since 2.7
143
110
  */
144
111
  'defer-src-invalidation'?: boolean;
@@ -146,42 +113,75 @@ export interface ImageProps extends StandardProps {
146
113
  /**
147
114
  * Specifies whether the animated image should start playing automatically once it is loaded.
148
115
  * @defaultValue true
149
- * @iOS
150
- * @Android
151
- * @Harmony
152
- * @PC
153
116
  * @since 2.11
154
117
  */
155
118
  'autoplay'?: boolean;
156
119
 
157
120
  /**
158
- * Changes the color of all non-transparent pixels to the tint-color specified. The value is a <color>.
121
+ * Image animation property. If set to false, images will not be cached. Each image will be discarded by default after use,
122
+ * which is suitable for scenarios where the animation needs to play only once.
123
+ * @defaultValue true
159
124
  * @iOS
160
- * @Android
161
- * @Harmony
125
+ * @since 3.4
126
+ */
127
+ 'ios-frame-cache-automatically'?: boolean;
128
+
129
+ /**
130
+ * Changes the color of all non-transparent pixels to the tint-color specified. The value is a <color>.
131
+ * @defaultValue ""
162
132
  * @since 2.12
163
133
  */
164
134
  'tint-color'?: string;
165
135
 
136
+ /**
137
+ * Support outputting image monitoring information in bindload
138
+ * @defaultValue false
139
+ * @since 2.12
140
+ */
141
+ 'extra-load-info'?: boolean;
142
+
143
+ /**
144
+ * Disables unexpected iOS built-in animations
145
+ * @defaultValue true
146
+ * @since iOS 2.0
147
+ */
148
+ 'implicit-animation'?: boolean;
149
+
150
+ /**
151
+ * Add custom parameters to image
152
+ * @since 2.17
153
+ */
154
+ 'additional-custom-info'?: { [key: string]: string };
155
+
166
156
  /**
167
157
  * Image load success event
168
- * @iOS
169
- * @Android
170
- * @Harmony
171
- * @PC
172
158
  * @since 0.2
173
159
  */
174
160
  bindload?: (e: LoadEvent) => void;
175
161
 
176
162
  /**
177
163
  * Image load error event
178
- * @iOS
179
- * @Android
180
- * @Harmony
181
- * @PC
182
164
  * @since 0.2
183
165
  */
184
166
  binderror?: (e: ErrorEvent) => void;
167
+
168
+ /**
169
+ * The animation will call back when it starts playing.
170
+ * @since 2.11
171
+ */
172
+ bindstartplay?: (e: BaseEvent) => void;
173
+
174
+ /**
175
+ * Call back after one loop time of the animation is played.
176
+ * @since 2.11
177
+ */
178
+ bindcurrentloopcomplete?: (e: BaseEvent) => void;
179
+
180
+ /**
181
+ * It will be called after the animation has been played for all loop-count times. If the loop-count is not set, it will not be called back.
182
+ * @since 2.11
183
+ */
184
+ bindfinalloopcomplete?: (e: BaseEvent) => void;
185
185
  }
186
186
 
187
187
  export type LoadEvent = BaseEvent<'load', ImageLoadEvent>;
@@ -189,10 +189,8 @@ export type ErrorEvent = BaseEvent<'error', ImageErrorEvent>;
189
189
 
190
190
  /**
191
191
  * Restart the animation playback method controlled by the front end, and the animation playback progress and loop count will be reset.
192
- * @iOS
193
192
  * @Android
194
- * @Harmony
195
- * @PC
193
+ * @iOS
196
194
  * @deprecated Deprecated. Some scenarios may not call back the call result. It is recommended to use resumeAnimation instead.
197
195
  */
198
196
  export interface ImageStartAnimMethod extends BaseMethod {
@@ -201,10 +199,8 @@ export interface ImageStartAnimMethod extends BaseMethod {
201
199
 
202
200
  /**
203
201
  * Resumes the animation, without resetting the loop-count.
204
- * @iOS
205
202
  * @Android
206
- * @Harmony
207
- * @PC
203
+ * @iOS
208
204
  * @since 2.11
209
205
  */
210
206
  export interface ImageResumeAnimMethod extends BaseMethod {
@@ -213,10 +209,8 @@ export interface ImageResumeAnimMethod extends BaseMethod {
213
209
 
214
210
  /**
215
211
  * Pauses the animation, without resetting the loop-count.
216
- * @iOS
217
212
  * @Android
218
- * @Harmony
219
- * @PC
213
+ * @iOS
220
214
  * @since 2.11
221
215
  */
222
216
  export interface ImagePauseAnimMethod extends BaseMethod {
@@ -225,10 +219,8 @@ export interface ImagePauseAnimMethod extends BaseMethod {
225
219
 
226
220
  /**
227
221
  * Stops the animation, and it will reset the loop-count.
228
- * @iOS
229
222
  * @Android
230
- * @Harmony
231
- * @PC
223
+ * @iOS
232
224
  * @since 2.11
233
225
  */
234
226
  export interface ImageStopAnimMethod extends BaseMethod {
@@ -128,7 +128,7 @@ export interface InputProps extends Omit<StandardProps, 'bindfocus' | 'bindblur'
128
128
  */
129
129
  maxlength?: number;
130
130
  /**
131
- * Readonly
131
+ * Interaction enabled
132
132
  * @defaultValue false
133
133
  * @Android
134
134
  * @iOS
@@ -137,15 +137,7 @@ export interface InputProps extends Omit<StandardProps, 'bindfocus' | 'bindblur'
137
137
  * @since 3.4
138
138
  */
139
139
  readonly?: boolean;
140
- /**
141
- * Interaction enabled
142
- * @defaultValue false
143
- * @Android
144
- * @iOS
145
- * @Harmony
146
- * @since 3.5
147
- */
148
- disabled?: boolean;
140
+
149
141
  /**
150
142
  * Show soft input keyboard while focused
151
143
  * @defaultValue true
@@ -757,15 +757,6 @@ export interface ListProps extends StandardProps {
757
757
  */
758
758
  'need-visible-item-info'?: boolean;
759
759
 
760
- /**
761
- * Control whether the span count can be dynamically switched. The default value is true. If set to true, the list will try to maintain stability of layout, and if set to false, the list will layout from the first list-item.
762
- * @defaultValue true
763
- * @Android
764
- * @iOS
765
- * @Harmony
766
- */
767
- 'enable-dynamic-span-count'?: boolean;
768
-
769
760
  /**
770
761
  * Specify the callback frequency of the scroll event by passing in a value, which specifies how many milliseconds (ms) <list> will call the scroll callback event during scrolling.
771
762
  * @defaultValue 200
@@ -1104,6 +1095,16 @@ export interface ListItemProps extends StandardProps {
1104
1095
  */
1105
1096
  'item-key': string;
1106
1097
 
1098
+ /**
1099
+ * Control whether the list-item can be recycled. If set to false, the list-item will not be recycled after being scrolled off the screen, and do not need to be re-rendered when they come back on the screen. The default value is true.
1100
+ * @since 3.4
1101
+ * @defaultValue true
1102
+ * @Android
1103
+ * @iOS
1104
+ * @Harmony
1105
+ */
1106
+ recyclable?: boolean | undefined;
1107
+
1107
1108
  bindnodeappear?: EventHandler<AppearanceEvent>;
1108
1109
  bindnodedisappear?: EventHandler<AppearanceEvent>;
1109
1110
  }
@@ -4,11 +4,11 @@
4
4
 
5
5
  import { BaseMethod, Callback } from '../events';
6
6
  import { AutoScrollMethod, ScrollToPositionMethod } from './list';
7
- import { ScrollViewUIMethods } from './scroll-view';
7
+ import { ScrollToMethod } from './scroll-view';
8
8
 
9
9
  export type ListParams = ScrollToPositionMethod;
10
10
 
11
- export type ScrollViewParams = ScrollViewUIMethods | AutoScrollMethod;
11
+ export type ScrollViewParams = ScrollToMethod | AutoScrollMethod;
12
12
 
13
13
  interface BoundingClientRectMethod extends BaseMethod {
14
14
  method: 'boundingClientRect';
@@ -4,6 +4,7 @@
4
4
 
5
5
  import { BaseEvent, BaseMethod, EventHandler } from '../events';
6
6
  import { StandardProps } from '../props';
7
+ import { AutoScrollMethod } from './list';
7
8
  import {
8
9
  ContentSizeChangedEvent,
9
10
  ScrollEndEvent,
@@ -17,101 +18,172 @@ import {
17
18
  } from './common';
18
19
 
19
20
  export interface ScrollViewProps extends StandardProps {
21
+ /**
22
+ * Scroll horizontaly.
23
+ * @defaultValue false
24
+ * @since 1.4
25
+ * @iOS
26
+ * @Android
27
+ * @H
28
+ */
29
+ 'scroll-x'?: boolean;
30
+
31
+ /**
32
+ * Scroll vertically
33
+ * @defaultValue false
34
+ * @since 1.4
35
+ * @iOS
36
+ * @Android
37
+ * @H
38
+ */
39
+ 'scroll-y'?: boolean;
40
+
20
41
  /**
21
42
  * Replacement of scroll-x and scroll-y
22
- * @defaultValue 'vertical'
23
43
  * @since 3.0
24
44
  * @iOS
25
45
  * @Android
26
- * @Harmony
27
- * @PC
46
+ * @H
28
47
  */
29
48
  'scroll-orientation'?: 'vertical' | 'horizontal';
30
49
 
31
50
  /**
32
51
  * Enable bounce effect
33
- * @defaultValue true
52
+ * @defaultValue false
34
53
  * @since 1.4
35
54
  * @iOS
36
- * @Harmony
37
- * @PC
55
+ * @Android
56
+ * @H
38
57
  */
39
58
  bounces?: boolean;
40
59
 
41
60
  /**
42
61
  * Enable dragging
43
- * @defaultValue true
62
+ * @defaultValue false
44
63
  * @since 1.4
45
64
  * @iOS
46
65
  * @Android 2.2
47
- * @Harmony
48
- * @PC
66
+ * @H
49
67
  */
50
68
  'enable-scroll'?: boolean;
51
69
 
52
70
  /**
53
71
  * Enable scrollbar
54
- * @defaultValue true
72
+ * @defaultValue false
55
73
  * @since 1.4
56
74
  * @iOS
57
- * @Harmony
58
- * @PC
75
+ * @Android
76
+ * @H
59
77
  */
60
78
  'scroll-bar-enable'?: boolean;
61
79
 
62
80
  /**
63
- * Set upper threshold to bindscrolltoupper event.
81
+ * Not recommended to use. Please use upper-threshold-item-count instead. Set upper threshold to bindscrolltoupper event.
64
82
  * @defaultValue 0
65
83
  * @since 1.4
66
84
  * @iOS
67
85
  * @Android
68
- * @Harmony
69
- * @PC
86
+ * @H
70
87
  */
71
88
  'upper-threshold'?: number;
72
89
 
73
90
  /**
74
- * Set upper threshold to bindscrolltoupper event.
91
+ * Not recommended to use. Please use lower-threshold-item-count instead. Set upper threshold to bindscrolltoupper event.
75
92
  * @defaultValue 0
76
93
  * @since 1.4
77
94
  * @iOS
78
95
  * @Android
79
- * @Harmony
80
- * @PC
96
+ * @H
81
97
  */
82
98
  'lower-threshold'?: number;
83
99
 
84
100
  /**
85
- * Initial scroll position, only effective once, in PX
101
+ * Please use initial-scroll-offset or ScrollTo method. Set the content offset from the top.
102
+ * @defaultValue 0
103
+ * @since 1.4
104
+ * @deprecated 2.17
105
+ * @iOS
106
+ * @Android
107
+ * @H
108
+ */
109
+ 'scroll-top'?: number;
110
+
111
+ /**
112
+ * Please use initial-scroll-offset or ScrollTo method. Set the content offset from the left.
113
+ * @defaultValue 0
114
+ * @since 1.4
115
+ * @deprecated 2.17
116
+ * @iOS
117
+ * @Android
118
+ * @H
119
+ */
120
+ 'scroll-left'?: number;
121
+
122
+ /**
123
+ * Initial scroll position, only effective once
86
124
  * @defaultValue 0
87
125
  * @since 2.17
88
126
  * @iOS
89
127
  * @Android
90
- * @Harmony
91
- * @PC
128
+ * @H
92
129
  */
93
130
  'initial-scroll-offset'?: number;
94
131
 
132
+ /**
133
+ * Please use initial-scroll-index or ScrollTo method。Set the first item at the first screen
134
+ * @defaultValue 0
135
+ * @since 2.1
136
+ * @deprecated 2.17
137
+ * @iOS
138
+ * @Android
139
+ */
140
+ 'scroll-to-index'?: number;
141
+
95
142
  /**
96
143
  * Scroll to specified child node on first screen, only effective once. All direct child nodes must be flatten=false.
97
144
  * @defaultValue 0
98
145
  * @since 2.17
99
146
  * @iOS
100
147
  * @Android
101
- * @Harmony
102
- * @PC
148
+ * @H
103
149
  */
104
150
  'initial-scroll-to-index'?: number;
105
151
 
152
+ /**
153
+ * On iOS, force-can-scroll should be used with ios-block-gesture-class and ios-recognized-view-tag. Can be used alone on Android.
154
+ * @defaultValue false
155
+ * @since 2.10.1
156
+ * @iOS
157
+ * @Android
158
+ * @H
159
+ */
160
+ 'force-can-scroll'?: boolean;
161
+
162
+ /**
163
+ * Force-can-scroll should be used with ios-block-gesture-class、ios-recognized-view-tag. Specify the class name of scrollable container that should be blocked by force-can-scroll. Given by container's developer.
164
+ * @defaultValue none
165
+ * @since 2.10.1
166
+ * @iOS
167
+ */
168
+ 'ios-block-gesture-class'?: string;
169
+
170
+ /**
171
+ * force-can-scroll should be used with ios-block-gesture-class、ios-recognized-view-tag. Specify scrollable container's tag, the UIView's tag. Set and given by container's developer.
172
+ * @defaultValue none
173
+ * @since 2.10.1
174
+ * @iOS
175
+ */
176
+ 'ios-recognized-view-tag'?: number;
177
+
106
178
  /**
107
179
  * This event is triggered when the upper/left edge of the scrolling area intersects with the visible area defined by the upperThreshold.
108
180
  * @defaultValue none
109
181
  * @since 1.4
110
182
  * @iOS
111
183
  * @Android
112
- * @Harmony
184
+ * @H
113
185
  */
114
- bindscrolltoupper?: (e: ScrollToUpperEvent) => void;
186
+ bindscrolltoupper?: EventHandler<ScrollToUpperEvent>;
115
187
 
116
188
  /**
117
189
  * This event is triggered when the lower/right edge of the scrolling area intersects with the visible area defined by the lowerThreshold.
@@ -119,9 +191,9 @@ export interface ScrollViewProps extends StandardProps {
119
191
  * @since 1.4
120
192
  * @iOS
121
193
  * @Android
122
- * @Harmony
194
+ * @H
123
195
  */
124
- bindscrolltolower?: (e: ScrollToLowerEvent) => void;
196
+ bindscrolltolower?: EventHandler<ScrollToLowerEvent>;
125
197
 
126
198
  /**
127
199
  * This event is triggered when the scrollview is scrolling.
@@ -129,10 +201,9 @@ export interface ScrollViewProps extends StandardProps {
129
201
  * @since 1.4
130
202
  * @iOS
131
203
  * @Android
132
- * @Harmony
133
- * @PC
204
+ * @H
134
205
  */
135
- bindscroll?: (e: ScrollEvent) => void;
206
+ bindscroll?: EventHandler<ScrollEvent>;
136
207
 
137
208
  /**
138
209
  * This event is triggered when the scrollview's scroll ended.
@@ -140,10 +211,9 @@ export interface ScrollViewProps extends StandardProps {
140
211
  * @since 1.6
141
212
  * @iOS
142
213
  * @Android
143
- * @Harmony
144
- * @PC
214
+ * @H
145
215
  */
146
- bindscrollend?: (e: ScrollEndEvent) => void;
216
+ bindscrollend?: EventHandler<ScrollEndEvent>;
147
217
 
148
218
  /**
149
219
  * This event is triggered when the scrollview's content size changed.
@@ -151,19 +221,42 @@ export interface ScrollViewProps extends StandardProps {
151
221
  * @since 1.6
152
222
  * @iOS
153
223
  * @Android
154
- * @Harmony
224
+ * @H
225
+ */
226
+ bindcontentsizechanged?: EventHandler<ContentSizeChangedEvent>;
227
+
228
+ /**
229
+ * scrollview scrolls to upper edge
230
+ * @defaultValue none
231
+ * @since 3.0
232
+ * @iOS
233
+ * @Android
234
+ * @H
155
235
  */
156
- bindcontentsizechanged?: (e: ContentSizeChangedEvent) => void;
236
+ bindscrolltoupperedge?: EventHandler<ScrollToUpperEdgeEvent>;
237
+
238
+ /**
239
+ * scrollview scrolls to lower edge
240
+ * @defaultValue none
241
+ * @since 3.0
242
+ * @iOS
243
+ * @Android
244
+ * @H
245
+ */
246
+ bindscrolltoloweredge?: EventHandler<ScrollToLowerEdgeEvent>;
247
+
248
+ /**
249
+ * scrollview scrolls to normal position. Not at upper or lower edge
250
+ * @defaultValue none
251
+ * @since 3.0
252
+ * @iOS
253
+ * @Android
254
+ * @H
255
+ */
256
+ bindscrolltonormalstate?: EventHandler<ScrollToNormalStateEvent>;
157
257
  }
158
258
 
159
- /**
160
- * Scroll to specified position
161
- * @Android
162
- * @iOS
163
- * @Harmony
164
- * @PC
165
- */
166
- export interface ScrollViewScrollToMethod extends BaseMethod {
259
+ export interface ScrollToMethod extends BaseMethod {
167
260
  method: 'scrollTo';
168
261
  params: {
169
262
  /**
@@ -184,52 +277,4 @@ export interface ScrollViewScrollToMethod extends BaseMethod {
184
277
  };
185
278
  }
186
279
 
187
- /**
188
- * Scroll by specified offset
189
- * @Android
190
- * @iOS
191
- * @Harmony
192
- * @PC
193
- */
194
- export interface ScrollViewScrollByMethod extends BaseMethod {
195
- method: 'scrollBy';
196
- params: {
197
- /**
198
- * Offset to scroll
199
- */
200
- offset?: number;
201
- };
202
- }
203
-
204
-
205
-
206
- /**
207
- * Automatic scrolling
208
- * @Android
209
- * @iOS
210
- * @Harmony
211
- * @PC
212
- */
213
- export interface ScrollViewAutoScrollMethod extends BaseMethod {
214
- method: 'autoScroll';
215
- params: {
216
- /**
217
- * The distance of each second's scrolling, which supports positive and negative values. The unit of distance can be "px", "rpx", "ppx", or null (for iOS, the value must be greater than 1/screen.scale px).
218
- * @Android
219
- * @iOS
220
- * @Harmony
221
- * @PC
222
- */
223
- rate: number;
224
- /**
225
- * Start/stop automatic scrolling.
226
- * @Android
227
- * @iOS
228
- * @Harmony
229
- * @PC
230
- */
231
- start: boolean;
232
- };
233
- }
234
-
235
- export type ScrollViewUIMethods = ScrollViewScrollToMethod | ScrollViewScrollByMethod | ScrollViewAutoScrollMethod;
280
+ export type ScrollViewUIMethods = ScrollToMethod | AutoScrollMethod;
@@ -11,16 +11,14 @@ import { StandardProps } from '../props';
11
11
  export interface TextProps extends StandardProps {
12
12
  /**
13
13
  * Maximum number of lines for text display
14
- * @Android
15
- * @iOS
16
- * @Harmony
17
- * @PC
14
+ * @defaultValue "-1"
18
15
  * @since 1.0
19
16
  */
20
17
  'text-maxline'?: string;
21
18
 
22
19
  /**
23
20
  * Maximum number of characters for text display
21
+ * @defaultValue ""
24
22
  * @since 1.0
25
23
  * @deprecated Suggest preprocessing the text content length.
26
24
  */
@@ -29,7 +27,6 @@ export interface TextProps extends StandardProps {
29
27
  /**
30
28
  * Whether font-size is affected by system font scaling
31
29
  * @defaultValue false
32
- * @deprecated
33
30
  * @since 1.6
34
31
  */
35
32
  'enable-font-scaling'?: boolean;
@@ -45,18 +42,15 @@ export interface TextProps extends StandardProps {
45
42
  /**
46
43
  * By default, if text truncation occurs, the color of the inserted ... will be specified by the style on the nearest inline-text. If this attribute is enabled, the color of ... will be specified by the style on the outermost text tag.
47
44
  * @defaultValue false
48
- * @Android
49
- * @iOS
50
45
  * @since 2.0
51
46
  */
52
47
  'tail-color-convert'?: boolean;
53
48
 
54
49
  /**
55
50
  * Set single-line plain text to be centered and aligned within the line. Inline text settings are not supported. Recommended only when the default font doesn't meet center alignment needs, as it increases text measurement time.
56
- * @defaultValue 'normal'
51
+ * @defaultValue normal
57
52
  * @iOS
58
53
  * @Android
59
- * @PC
60
54
  * @since 2.12
61
55
  */
62
56
  'text-single-line-vertical-align'?: 'normal' | 'bottom' | 'center' | 'top';
@@ -116,17 +110,11 @@ export interface TextProps extends StandardProps {
116
110
  /**
117
111
  * Text layout event
118
112
  * @since 2.7
119
- * @Android
120
- * @iOS
121
- * @Harmony
122
- * @PC
123
113
  */
124
114
  bindlayout?: (e: LayoutEvent) => void;
125
115
 
126
116
  /**
127
117
  * Text selection change event
128
- * @Android
129
- * @iOS
130
118
  * @since 2.18
131
119
  */
132
120
  bindselectionchange?: (e: SelectionChangeEvent) => void;
@@ -217,7 +205,6 @@ interface SetTextSelectionMethod extends BaseMethod {
217
205
  * Gets the bounding rectangle of the text.
218
206
  * @Android
219
207
  * @iOS
220
- * @PC
221
208
  * @since 2.18
222
209
  */
223
210
  interface GetTextBoundingRectMethod extends BaseMethod {
@@ -152,7 +152,7 @@ export interface TextAreaProps extends Omit<StandardProps, 'bindfocus' | 'bindbl
152
152
  */
153
153
  'line-spacing'?: number | `${number}px` | `${number}rpx`;
154
154
  /**
155
- * Readonly
155
+ * Interaction enabled
156
156
  * @defaultValue false
157
157
  * @Android
158
158
  * @iOS
@@ -162,16 +162,6 @@ export interface TextAreaProps extends Omit<StandardProps, 'bindfocus' | 'bindbl
162
162
  */
163
163
  readonly?: boolean;
164
164
 
165
- /**
166
- * Interaction enabled
167
- * @defaultValue false
168
- * @Android
169
- * @iOS
170
- * @Harmony
171
- * @since 3.5
172
- */
173
- disabled?: boolean;
174
-
175
165
  /**
176
166
  * Show soft input keyboard while focused
177
167
  * @defaultValue true
@@ -173,25 +173,33 @@ export interface BaseTransitionEvent<T> extends BaseEventOrig<{}, T> {
173
173
  export interface TransitionEvent extends BaseTransitionEvent<Target> {}
174
174
 
175
175
  export interface BaseImageLoadEvent<T> extends BaseEventOrig<{}, T> {
176
+ detail: {
176
177
  width: number;
177
178
  height: number;
179
+ };
178
180
  }
179
181
 
180
182
  export interface ImageLoadEvent extends BaseImageLoadEvent<Target> {
183
+ detail: {
181
184
  width: number;
182
185
  height: number;
186
+ };
183
187
  }
184
188
 
185
189
  export interface BaseImageErrorEvent<T> extends BaseEventOrig<{}, T> {
190
+ detail: {
186
191
  errMsg: string;
187
192
  error_code: number;
188
193
  lynx_categorized_code: number;
194
+ };
189
195
  }
190
196
 
191
197
  export interface ImageErrorEvent extends BaseImageErrorEvent<Target> {
198
+ detail: {
192
199
  errMsg: string;
193
200
  error_code: number;
194
201
  lynx_categorized_code: number;
202
+ };
195
203
  }
196
204
 
197
205
  export interface TextLineInfo {
@@ -446,83 +454,11 @@ export interface LynxBindCatchEvent<T = any> {
446
454
  LongTap?: EventHandler<BaseTouchEvent<T>>;
447
455
  }
448
456
 
449
- type PrefixedEvent<E> = {
450
- bind?: E;
451
- catch?: E;
452
- 'capture-bind'?: E;
453
- 'capture-catch'?: E;
454
- 'global-bind'?: E;
455
- }
456
-
457
- // Helper interfaces for each event, providing explicit properties
458
- // for bind, catch, capture-bind, capture-catch, and global-bind prefixes.
459
- 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']; }
460
- 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']; }
461
- 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']; }
462
- 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']; }
463
- 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']; }
464
- 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']; }
465
- 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']; }
466
- 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']; }
467
- 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']; }
468
- 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']; }
469
- 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']; }
470
- 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']; }
471
- 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']; }
472
- 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']; }
473
- 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']; }
474
- 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']; }
475
- 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']; }
476
- 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']; }
477
- 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']; }
478
- 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']; }
479
- 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']; }
480
- 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']; }
481
- 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']; }
482
- 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']; }
483
- 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']; }
484
- 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']; }
485
- 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']; }
486
- 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']; }
487
- 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']; }
488
- 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']; }
489
- 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']; }
490
-
491
- /**
492
- * A combination of all possible event properties, statically defined for IDE-friendliness.
493
- * This replaces the previous dynamic mapped type.
494
- */
495
- export type LynxEventPropsBase<T> = BGLoadProps<T> &
496
- BGErrorProps<T> &
497
- TouchStartProps<T> &
498
- TouchMoveProps<T> &
499
- TouchCancelProps<T> &
500
- TouchEndProps<T> &
501
- LongPressProps<T> &
502
- TransitionStartProps<T> &
503
- TransitionCancelProps<T> &
504
- TransitionEndProps<T> &
505
- AnimationStartProps<T> &
506
- AnimationIterationProps<T> &
507
- AnimationCancelProps<T> &
508
- AnimationEndProps<T> &
509
- MouseDownProps<T> &
510
- MouseUpProps<T> &
511
- MouseMoveProps<T> &
512
- MouseClickProps<T> &
513
- MouseDblClickProps<T> &
514
- MouseLongPressProps<T> &
515
- WheelProps<T> &
516
- KeyDownProps<T> &
517
- KeyUpProps<T> &
518
- FocusProps<T> &
519
- BlurProps<T> &
520
- LayoutChangeProps<T> &
521
- UIAppearProps<T> &
522
- UIDisappearProps<T> &
523
- AccessibilityActionProps<T> &
524
- TapProps<T> &
525
- LongTapProps<T>;
457
+ export type LynxEventPropsBase<T> = {
458
+ [K in keyof LynxEvent<T> as Lowercase<`bind${K}` | `catch${K}` | `capture-bind${K}` | `capture-catch${K}` | `global-bind${K}`>]: LynxEvent<T>[K];
459
+ } & {
460
+ [K in keyof LynxBindCatchEvent<T> as Lowercase<`bind${K}` | `catch${K}` | `capture-bind${K}` | `capture-catch${K}` | `global-bind${K}`>]: LynxBindCatchEvent<T>[K];
461
+ };
526
462
 
527
463
  export type LynxEventProps = LynxEventPropsBase<Target>;
528
464
 
@@ -39,8 +39,7 @@ declare global {
39
39
  * @since 3.0
40
40
  * below Lynx 3.0, use lynx.cancelAnimationFrame.
41
41
  */
42
- function cancelAnimationFrame(requestID?: number): void;
43
-
42
+ function cancelAnimationFrame(requestID?: number): void;
44
43
  }
45
44
 
46
45
  declare function setTimeout(callback: (...args: unknown[]) => unknown, number: number): number;
@@ -7,18 +7,9 @@
7
7
  */
8
8
  export interface TraceOption {
9
9
  /**
10
- * An optional unique identifier for tracing a single event flow.
11
- *
12
- * Note: If `flowIds` is set, this parameter will be ignored.
10
+ * An optional unique identifier for tracing the event flow.
13
11
  */
14
12
  flowId?: number;
15
-
16
- /**
17
- * An optional unique identifier for tracing multiple event flows.
18
- * Support from Lynx 3.5
19
- */
20
- flowIds?: number[];
21
-
22
13
  /**
23
14
  * An optional collection of key-value pairs providing additional context for the tracing event.
24
15
  */
@@ -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,8 +3,29 @@
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 {
9
+ styles: CSSProperties;
10
+ attributes: Record<string, any>;
11
+ scrollBy: (
12
+ width: number,
13
+ height: number
14
+ ) => {
15
+ consumedX: number;
16
+ consumedY: number;
17
+ unconsumedX: number;
18
+ unconsumedY: number;
19
+ };
20
+ getBoundingClientRect: () => {
21
+ width: number;
22
+ height: number;
23
+ top: number;
24
+ bottom: number;
25
+ left: number;
26
+ right: number;
27
+ };
28
+
8
29
  /**
9
30
  * Set an attribute.
10
31
  * @param attributeName The name of the attribute.
@@ -62,4 +83,15 @@ export interface Element {
62
83
  * @since Lynx 2.14
63
84
  */
64
85
  invoke(methodName: string, params?: Record<string, any>): Promise<any>;
86
+
87
+ /**
88
+ * Animate the element.
89
+ * @param keyframes The keyframes for the animation.
90
+ * @param options The options for the animation.
91
+ * @since Lynx 3.4
92
+ */
93
+ animate(
94
+ keyframes: Record<string, number | string>[],
95
+ options?: number | AnimationOptions,
96
+ ): Animation;
65
97
  }
@@ -5,3 +5,4 @@
5
5
  export * from './lynx';
6
6
  export * from './element';
7
7
  export * from './events';
8
+ export * from './animation'