@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
|
@@ -11,7 +11,11 @@ import { StandardProps } from '../props';
|
|
|
11
11
|
export interface ImageProps extends StandardProps {
|
|
12
12
|
/**
|
|
13
13
|
* Supports http/https/base64
|
|
14
|
-
* @defaultValue
|
|
14
|
+
* @defaultValue undefined
|
|
15
|
+
* @iOS
|
|
16
|
+
* @Android
|
|
17
|
+
* @Harmony
|
|
18
|
+
* @PC
|
|
15
19
|
* @since 0.2
|
|
16
20
|
*/
|
|
17
21
|
src?: string;
|
|
@@ -22,81 +26,108 @@ export interface ImageProps extends StandardProps {
|
|
|
22
26
|
* aspectFit: Scales the image while preserving aspect ratio so that the long side is fully visible
|
|
23
27
|
* aspectFill: Scales the image while preserving aspect ratio, ensuring the short side fills the element
|
|
24
28
|
* center: Does not scale the image; image is centered
|
|
25
|
-
* @defaultValue
|
|
29
|
+
* @defaultValue 'scaleToFill'
|
|
26
30
|
* @since 0.2
|
|
31
|
+
* @iOS
|
|
32
|
+
* @Android
|
|
33
|
+
* @Harmony
|
|
34
|
+
* @PC
|
|
27
35
|
*/
|
|
28
36
|
mode?: 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'center';
|
|
29
37
|
|
|
30
38
|
/**
|
|
31
39
|
* ARGB_8888: 32-bit memory per pixel, supports semi-transparent images
|
|
32
40
|
* RGB_565: 16-bit memory per pixel, reduces memory usage but loses transparency
|
|
41
|
+
* Support PC platform since 3.5
|
|
33
42
|
* @defaultValue "ARGB_8888"
|
|
43
|
+
* @Android
|
|
44
|
+
* @PC
|
|
34
45
|
* @since 1.4
|
|
35
46
|
*/
|
|
36
47
|
'image-config'?: 'ARGB_8888' | 'RGB_565';
|
|
37
48
|
|
|
38
49
|
/**
|
|
39
50
|
* Placeholder image, used same as src
|
|
40
|
-
* @
|
|
51
|
+
* @iOS
|
|
52
|
+
* @Android
|
|
53
|
+
* @Harmony
|
|
54
|
+
* @PC
|
|
41
55
|
* @since 1.4
|
|
42
56
|
*/
|
|
43
57
|
placeholder?: string;
|
|
44
58
|
|
|
45
59
|
/**
|
|
46
60
|
* Image blur radius
|
|
47
|
-
* @
|
|
61
|
+
* @iOS
|
|
62
|
+
* @Android
|
|
63
|
+
* @Harmony
|
|
64
|
+
* @PC
|
|
48
65
|
* @since 0.2
|
|
49
66
|
*/
|
|
50
67
|
'blur-radius'?: string;
|
|
51
68
|
|
|
52
69
|
/**
|
|
53
70
|
* Stretchable area for 9patch images, in percentage or decimal, four values for top, right, bottom, left
|
|
54
|
-
* @
|
|
71
|
+
* @iOS
|
|
72
|
+
* @Android
|
|
73
|
+
* @Harmony
|
|
74
|
+
* @PC
|
|
55
75
|
* @since 1.4
|
|
56
76
|
*/
|
|
57
77
|
'cap-insets'?: string;
|
|
58
78
|
|
|
59
79
|
/**
|
|
60
|
-
*
|
|
80
|
+
* Adjust the scale of stretchable area for 9patch images
|
|
61
81
|
* @defaultValue 1
|
|
82
|
+
* @iOS
|
|
83
|
+
* @Android
|
|
84
|
+
* @Harmony
|
|
85
|
+
* @PC
|
|
86
|
+
* @since 1.4
|
|
87
|
+
*/
|
|
88
|
+
'cap-insets-scale'?: number;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Number of times an animated image plays, 0 stands for infinite
|
|
92
|
+
* @defaultValue 0
|
|
93
|
+
* @iOS
|
|
94
|
+
* @Android
|
|
95
|
+
* @Harmony
|
|
96
|
+
* @PC
|
|
62
97
|
* @since 1.4
|
|
63
98
|
*/
|
|
64
99
|
'loop-count'?: number;
|
|
65
100
|
|
|
66
101
|
/**
|
|
67
102
|
* Image won't load if its size is 0, but will load if prefetch-width is set
|
|
68
|
-
* @defaultValue "
|
|
103
|
+
* @defaultValue "0px"
|
|
104
|
+
* @deprecated
|
|
105
|
+
* @iOS
|
|
106
|
+
* @Android
|
|
69
107
|
* @since 1.4
|
|
70
108
|
*/
|
|
71
109
|
'prefetch-width'?: string;
|
|
72
110
|
|
|
73
111
|
/**
|
|
74
112
|
* Image won't load if its size is 0, but will load if prefetch-height is set
|
|
75
|
-
* @defaultValue "
|
|
113
|
+
* @defaultValue "0px"
|
|
114
|
+
* @deprecated
|
|
115
|
+
* @iOS
|
|
116
|
+
* @Android
|
|
76
117
|
* @since 1.4
|
|
77
118
|
*/
|
|
78
119
|
'prefetch-height'?: string;
|
|
79
120
|
|
|
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
|
-
|
|
94
121
|
/**
|
|
95
122
|
* When set to true and the <image> element has no width or height,
|
|
96
123
|
* the size of the <image> will be automatically adjusted
|
|
97
124
|
* to match the image's original dimensions after the image is successfully loaded,
|
|
98
125
|
* ensuring that the aspect ratio is maintained.
|
|
99
126
|
* @defaultValue false
|
|
127
|
+
* @iOS
|
|
128
|
+
* @Android
|
|
129
|
+
* @Harmony
|
|
130
|
+
* @PC
|
|
100
131
|
* @since 2.6
|
|
101
132
|
*/
|
|
102
133
|
'auto-size'?: boolean;
|
|
@@ -106,6 +137,10 @@ export interface ImageProps extends StandardProps {
|
|
|
106
137
|
* The default behavior is to clear the image resource before starting a new load.
|
|
107
138
|
* 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.
|
|
108
139
|
* @defaultValue false
|
|
140
|
+
* @iOS
|
|
141
|
+
* @Android
|
|
142
|
+
* @Harmony
|
|
143
|
+
* @PC
|
|
109
144
|
* @since 2.7
|
|
110
145
|
*/
|
|
111
146
|
'defer-src-invalidation'?: boolean;
|
|
@@ -113,75 +148,42 @@ export interface ImageProps extends StandardProps {
|
|
|
113
148
|
/**
|
|
114
149
|
* Specifies whether the animated image should start playing automatically once it is loaded.
|
|
115
150
|
* @defaultValue true
|
|
151
|
+
* @iOS
|
|
152
|
+
* @Android
|
|
153
|
+
* @Harmony
|
|
154
|
+
* @PC
|
|
116
155
|
* @since 2.11
|
|
117
156
|
*/
|
|
118
157
|
'autoplay'?: boolean;
|
|
119
158
|
|
|
120
|
-
/**
|
|
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
|
|
124
|
-
* @iOS
|
|
125
|
-
* @since 3.4
|
|
126
|
-
*/
|
|
127
|
-
'ios-frame-cache-automatically'?: boolean;
|
|
128
|
-
|
|
129
159
|
/**
|
|
130
160
|
* Changes the color of all non-transparent pixels to the tint-color specified. The value is a <color>.
|
|
131
|
-
* @
|
|
161
|
+
* @iOS
|
|
162
|
+
* @Android
|
|
163
|
+
* @Harmony
|
|
132
164
|
* @since 2.12
|
|
133
165
|
*/
|
|
134
166
|
'tint-color'?: string;
|
|
135
167
|
|
|
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
|
-
|
|
156
168
|
/**
|
|
157
169
|
* Image load success event
|
|
170
|
+
* @iOS
|
|
171
|
+
* @Android
|
|
172
|
+
* @Harmony
|
|
173
|
+
* @PC
|
|
158
174
|
* @since 0.2
|
|
159
175
|
*/
|
|
160
176
|
bindload?: (e: LoadEvent) => void;
|
|
161
177
|
|
|
162
178
|
/**
|
|
163
179
|
* Image load error event
|
|
180
|
+
* @iOS
|
|
181
|
+
* @Android
|
|
182
|
+
* @Harmony
|
|
183
|
+
* @PC
|
|
164
184
|
* @since 0.2
|
|
165
185
|
*/
|
|
166
186
|
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
187
|
}
|
|
186
188
|
|
|
187
189
|
export type LoadEvent = BaseEvent<'load', ImageLoadEvent>;
|
|
@@ -189,8 +191,10 @@ export type ErrorEvent = BaseEvent<'error', ImageErrorEvent>;
|
|
|
189
191
|
|
|
190
192
|
/**
|
|
191
193
|
* Restart the animation playback method controlled by the front end, and the animation playback progress and loop count will be reset.
|
|
192
|
-
* @Android
|
|
193
194
|
* @iOS
|
|
195
|
+
* @Android
|
|
196
|
+
* @Harmony
|
|
197
|
+
* @PC
|
|
194
198
|
* @deprecated Deprecated. Some scenarios may not call back the call result. It is recommended to use resumeAnimation instead.
|
|
195
199
|
*/
|
|
196
200
|
export interface ImageStartAnimMethod extends BaseMethod {
|
|
@@ -199,8 +203,10 @@ export interface ImageStartAnimMethod extends BaseMethod {
|
|
|
199
203
|
|
|
200
204
|
/**
|
|
201
205
|
* Resumes the animation, without resetting the loop-count.
|
|
202
|
-
* @Android
|
|
203
206
|
* @iOS
|
|
207
|
+
* @Android
|
|
208
|
+
* @Harmony
|
|
209
|
+
* @PC
|
|
204
210
|
* @since 2.11
|
|
205
211
|
*/
|
|
206
212
|
export interface ImageResumeAnimMethod extends BaseMethod {
|
|
@@ -209,8 +215,10 @@ export interface ImageResumeAnimMethod extends BaseMethod {
|
|
|
209
215
|
|
|
210
216
|
/**
|
|
211
217
|
* Pauses the animation, without resetting the loop-count.
|
|
212
|
-
* @Android
|
|
213
218
|
* @iOS
|
|
219
|
+
* @Android
|
|
220
|
+
* @Harmony
|
|
221
|
+
* @PC
|
|
214
222
|
* @since 2.11
|
|
215
223
|
*/
|
|
216
224
|
export interface ImagePauseAnimMethod extends BaseMethod {
|
|
@@ -219,8 +227,10 @@ export interface ImagePauseAnimMethod extends BaseMethod {
|
|
|
219
227
|
|
|
220
228
|
/**
|
|
221
229
|
* Stops the animation, and it will reset the loop-count.
|
|
222
|
-
* @Android
|
|
223
230
|
* @iOS
|
|
231
|
+
* @Android
|
|
232
|
+
* @Harmony
|
|
233
|
+
* @PC
|
|
224
234
|
* @since 2.11
|
|
225
235
|
*/
|
|
226
236
|
export interface ImageStopAnimMethod extends BaseMethod {
|
|
@@ -6,6 +6,7 @@ export * from './component';
|
|
|
6
6
|
export * from './filter-image';
|
|
7
7
|
export * from './image';
|
|
8
8
|
export * from './list';
|
|
9
|
+
export * from './list-item';
|
|
9
10
|
export * from './page';
|
|
10
11
|
export * from './scroll-view';
|
|
11
12
|
export * from './text';
|
|
@@ -16,3 +17,4 @@ export * from './element';
|
|
|
16
17
|
export * from './methods';
|
|
17
18
|
export * from './attributes';
|
|
18
19
|
export * from './common';
|
|
20
|
+
export * from './frame';
|
|
@@ -128,7 +128,7 @@ export interface InputProps extends Omit<StandardProps, 'bindfocus' | 'bindblur'
|
|
|
128
128
|
*/
|
|
129
129
|
maxlength?: number;
|
|
130
130
|
/**
|
|
131
|
-
*
|
|
131
|
+
* Readonly
|
|
132
132
|
* @defaultValue false
|
|
133
133
|
* @Android
|
|
134
134
|
* @iOS
|
|
@@ -137,7 +137,15 @@ export interface InputProps extends Omit<StandardProps, 'bindfocus' | 'bindblur'
|
|
|
137
137
|
* @since 3.4
|
|
138
138
|
*/
|
|
139
139
|
readonly?: boolean;
|
|
140
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Interaction enabled
|
|
142
|
+
* @defaultValue false
|
|
143
|
+
* @Android
|
|
144
|
+
* @iOS
|
|
145
|
+
* @Harmony
|
|
146
|
+
* @since 3.5
|
|
147
|
+
*/
|
|
148
|
+
disabled?: boolean;
|
|
141
149
|
/**
|
|
142
150
|
* Show soft input keyboard while focused
|
|
143
151
|
* @defaultValue true
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
|
|
5
|
+
import { StandardProps } from '../props';
|
|
6
|
+
|
|
7
|
+
export interface ListItemProps extends StandardProps {
|
|
8
|
+
/**
|
|
9
|
+
* The unique key of list child node, and it's a mandatory property.
|
|
10
|
+
* @Android
|
|
11
|
+
* @iOS
|
|
12
|
+
* @Harmony
|
|
13
|
+
* @PC
|
|
14
|
+
*/
|
|
15
|
+
'item-key': string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* sticky top effect. Not compatible with flatten.
|
|
19
|
+
* @defaultValue false
|
|
20
|
+
* @Android
|
|
21
|
+
* @iOS
|
|
22
|
+
* @Harmony
|
|
23
|
+
* @PC
|
|
24
|
+
*/
|
|
25
|
+
'sticky-top'?: boolean;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* sticky bottom effect. Not compatible with flatten.
|
|
29
|
+
* @defaultValue false
|
|
30
|
+
* @Android
|
|
31
|
+
* @iOS
|
|
32
|
+
* @Harmony
|
|
33
|
+
* @PC
|
|
34
|
+
*/
|
|
35
|
+
'sticky-bottom'?: boolean;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Adding the `full-span` attribute to `<list-item/>` will make it occupy a single line. You need to configure {@link ListProps."list-type" | list-type} correctly to make the list enter a multi-column layout for this to work.
|
|
39
|
+
* @defaultValue false
|
|
40
|
+
* @Android
|
|
41
|
+
* @iOS
|
|
42
|
+
* @Harmony
|
|
43
|
+
* @PC
|
|
44
|
+
*/
|
|
45
|
+
'full-span'?: boolean;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Preset size in main scroll axis to control the placeholder size of the view while the list component has not finished rendering. The more accurately it is set, the less flickering the list will have. If not set, we will use list size in main axis as the estimated size of list-item.
|
|
49
|
+
* @defaultValue -1
|
|
50
|
+
* @Android
|
|
51
|
+
* @iOS
|
|
52
|
+
* @Harmony
|
|
53
|
+
* @PC
|
|
54
|
+
*/
|
|
55
|
+
'estimated-main-axis-size-px'?: number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 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.
|
|
59
|
+
* @since 3.4
|
|
60
|
+
* @defaultValue true
|
|
61
|
+
* @Android
|
|
62
|
+
* @iOS
|
|
63
|
+
* @Harmony
|
|
64
|
+
* @PC
|
|
65
|
+
*/
|
|
66
|
+
recyclable?: boolean;
|
|
67
|
+
}
|