@lynx-js/types 3.3.2 → 3.4.3

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.
@@ -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
@@ -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;