@lynx-js/types 3.2.0 → 3.3.0

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,5 +1,43 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.3.0
4
+
5
+ ### Major Changes
6
+
7
+ - Update Types Version to 3.3.*
8
+ - Add default properties for PipelineEntry.frameworkRenderingTiming
9
+ - Add some missing typing of event props
10
+ - Add type testing for objects & methods mounted in global
11
+ - Add type testing to lynx react.JSX.IntrinsicElements
12
+ - Add some missing types of built-in element `list`
13
+ - Add some missing types of built-in element `image`
14
+ - Add more events like `LayoutChangeEvent` into `MainThread` namespace
15
+
16
+ In this commit, we add `AnimationEvent`, `TransitionEvent`, `LayoutChangeEvent`, `UIAppearanceEvent` into `MainThread` namespace.
17
+ Now you can use like this:
18
+
19
+ ```
20
+ function handleLayoutChange(e: MainThread.LayoutChangeEvent) {
21
+ // ...
22
+ }
23
+
24
+ <view
25
+ main-thread:bindlayoutchange={handleLayoutChange}
26
+ />
27
+ ```
28
+
29
+ ## 3.2.1
30
+
31
+ ### Patch Changes
32
+
33
+ - Add some missing types of built-in element `list-item`
34
+ - Rename PipelineEntry.FrameworkPipelineTiming to PipelineEntry.FrameworkRenderingTiming
35
+ - Supplement the missing `lynx.onError` definition
36
+ - partially support TextEncoder/TextDecoder
37
+ - Support needVisibleItemInfo for native List
38
+ - Add prop 'ios-background-shape-layer' for iOS
39
+ - lynx.requireModule support setting timeout time
40
+
3
41
  ## 3.2.0
4
42
 
5
43
  ### Major Changes
package/LICENSE ADDED
@@ -0,0 +1,203 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/types",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "",
5
5
  "keywords": ["lynx" , "types"],
6
6
  "license": "Apache-2.0",
@@ -8,7 +8,7 @@
8
8
  "types":"types/index.d.ts",
9
9
  "main": "types/index.d.ts",
10
10
  "scripts": {
11
- "test": ""
11
+ "test": "vitest --typecheck --run & tsc --noEmit"
12
12
  },
13
13
  "exports": {
14
14
  ".": {
@@ -53,6 +53,9 @@
53
53
  "csstype": "3.1.3"
54
54
  },
55
55
  "devDependencies": {
56
- "tsd": "0.30.4"
56
+ "@types/react": "18.3.5",
57
+ "typescript": "5.8.3",
58
+ "tsd": "0.30.4",
59
+ "vitest": "2.1.9"
57
60
  }
58
61
  }
@@ -6,7 +6,16 @@ export interface PerformanceEntry {
6
6
  entryType: string;
7
7
  }
8
8
 
9
- export interface FrameworkPipelineTiming {
9
+ export interface FrameworkRenderingTiming {
10
+ vmExecuteStart?: number;
11
+ vmExecuteEnd?: number;
12
+ dataProcessorStart?: number;
13
+ dataProcessorEnd?: number;
14
+ setInitDataStart?: number;
15
+ setInitDataEnd?: number;
16
+ }
17
+
18
+ export interface FrameworkRenderingTimings {
10
19
  }
11
20
 
12
21
  export interface PipelineEntry extends PerformanceEntry {
@@ -24,7 +33,7 @@ export interface PipelineEntry extends PerformanceEntry {
24
33
  layoutUiOperationExecuteStart: number;
25
34
  layoutUiOperationExecuteEnd: number;
26
35
  paintEnd: number;
27
- frameworkPipelineTiming: FrameworkPipelineTiming[keyof FrameworkPipelineTiming];
36
+ frameworkRenderingTiming: FrameworkRenderingTimings[keyof FrameworkRenderingTimings] & FrameworkRenderingTiming;
28
37
  }
29
38
 
30
39
  export interface LoadBundleEntry extends PipelineEntry {
@@ -89,10 +89,6 @@ export interface Lynx extends CommonLynx {
89
89
 
90
90
  getElementById: GetElementByIdFunc;
91
91
 
92
- // cancelAnimationFrame(animationId: number): void;
93
-
94
- // requestAnimationFrame(callback: () => void): number;
95
-
96
92
  cancelResourcePrefetch(data: ResourcePrefetchData, callback: (res: ResourcePrefetchResult) => void): void;
97
93
 
98
94
  createIntersectionObserver: CreateIntersectionObserverFunc;
@@ -120,7 +116,14 @@ export interface Lynx extends CommonLynx {
120
116
 
121
117
  requireModuleAsync<T>(path: string, callback: (error: Error | null, exports?: T) => void): void;
122
118
 
123
- requireModule<T>(path: string, entryName?: string): T;
119
+ /**
120
+ * @description requireModule
121
+ * @param path: the source's path
122
+ * @param entryName: the resource's entry's name
123
+ * @param options(@since 3.2): timeout is waiting time,the unit is seconds
124
+ * @since 1.0
125
+ */
126
+ requireModule<T>(path: string, entryName?: string, options?: {timeout: number }): T;
124
127
 
125
128
  resumeExposure(): void;
126
129
  stopExposure(options?: { sendEvent: boolean }): void;
@@ -141,4 +144,10 @@ export interface Lynx extends CommonLynx {
141
144
  */
142
145
  queueMicrotask(callback: () => void): void;
143
146
 
147
+ /**
148
+ * @description Callback when an error occurs
149
+ * @since 1.0
150
+ */
151
+ onError?: (error: Error) => void;
152
+
144
153
  }
@@ -0,0 +1,22 @@
1
+ export interface TextEncoder {
2
+ encode(str: string): ArrayBuffer;
3
+ encoding: 'utf-8';
4
+ }
5
+
6
+ type TypedArray =
7
+ | Int8Array
8
+ | Uint8Array
9
+ | Uint8ClampedArray
10
+ | Int16Array
11
+ | Uint16Array
12
+ | Int32Array
13
+ | Uint32Array
14
+ | Float32Array
15
+ | Float64Array;
16
+
17
+ export interface TextDecoder {
18
+ decode(buffer: ArrayBuffer | TypedArray | DataView): string;
19
+ encoding: 'utf-8';
20
+ fatal: false;
21
+ ignoreBOM: true;
22
+ }
@@ -41,7 +41,9 @@ export type CSSProperties = Modify<
41
41
  animationTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
42
42
  borderStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
43
43
  transformOrigin?: 'left' | 'right' | 'top' | 'bottom' | 'center' | (string & {});
44
+ linearDirection?: 'column' | 'row' | 'column-reverse' | 'row-reverse';
44
45
  linearOrientation?: 'horizontal' | 'vertical' | 'horizontal-reverse' | 'vertical-reverse';
46
+ linearWeight?: number;
45
47
  linearGravity?: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'center-vertical' | 'center-horizontal' | 'space-between' | 'start' | 'end' | 'center';
46
48
  linearLayoutGravity?:
47
49
  | 'none'
@@ -6,7 +6,7 @@ import { StandardProps } from '../props';
6
6
  import { NoProps } from '../props';
7
7
  import { ComponentProps } from './component';
8
8
  import { FilterImageProps } from './filter-image';
9
- import { ImageProps } from './image';
9
+ 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';
@@ -16,11 +16,14 @@ import { ViewProps } from './view';
16
16
  export interface UIMethods {
17
17
  'list': ListUIMethods;
18
18
  'scroll-view': ScrollViewUIMethods;
19
+ 'image': ImageUIMethods;
19
20
  }
20
21
 
22
+ type LynxComponentProps = ComponentProps;
23
+
21
24
  // add also to global.JSX.IntrinsicElements
22
25
  export interface IntrinsicElements {
23
- 'component': ComponentProps;
26
+ 'component': LynxComponentProps;
24
27
  'filter-image': FilterImageProps;
25
28
  'image': ImageProps;
26
29
  'inline-image': ImageProps;
@@ -40,7 +43,7 @@ declare module 'react' {
40
43
  namespace JSX {
41
44
  // Should copy from above IntrinsicElements
42
45
  interface IntrinsicElements {
43
- 'component': ComponentProps;
46
+ 'component': LynxComponentProps;
44
47
  'filter-image': FilterImageProps;
45
48
  'image': ImageProps;
46
49
  'inline-image': ImageProps;
@@ -2,7 +2,7 @@
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
- import { BaseEvent, ImageErrorEvent, ImageLoadEvent } from '../events';
5
+ import { BaseEvent, BaseMethod, ImageErrorEvent, ImageLoadEvent } from '../events';
6
6
  import { StandardProps } from '../props';
7
7
 
8
8
  /**
@@ -91,6 +91,46 @@ export interface ImageProps extends StandardProps {
91
91
  */
92
92
  downsampling?: boolean;
93
93
 
94
+ /**
95
+ * When set to true and the <image> element has no width or height,
96
+ * the size of the <image> will be automatically adjusted
97
+ * to match the image's original dimensions after the image is successfully loaded,
98
+ * ensuring that the aspect ratio is maintained.
99
+ * @defaultValue false
100
+ * @since 2.6
101
+ */
102
+ 'auto-size'?: boolean;
103
+
104
+ /**
105
+ * When set to true, the <image> will only clear the previously displayed image resource after a new image has successfully loaded.
106
+ * The default behavior is to clear the image resource before starting a new load.
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.
108
+ * @defaultValue false
109
+ * @since 2.7
110
+ */
111
+ 'defer-src-invalidation'?: boolean;
112
+
113
+ /**
114
+ * Specifies whether the animated image should start playing automatically once it is loaded.
115
+ * @defaultValue true
116
+ * @since 2.11
117
+ */
118
+ 'autoplay'?: boolean;
119
+
120
+ /**
121
+ * Changes the color of all non-transparent pixels to the tint-color specified. The value is a <color>.
122
+ * @defaultValue ""
123
+ * @since 2.12
124
+ */
125
+ 'tint-color'?: string;
126
+
127
+ /**
128
+ * Support outputting image monitoring information in bindload
129
+ * @defaultValue false
130
+ * @since 2.12
131
+ */
132
+ 'extra-load-info'?: boolean;
133
+
94
134
  /**
95
135
  * Disables unexpected iOS built-in animations
96
136
  * @defaultValue true
@@ -98,6 +138,12 @@ export interface ImageProps extends StandardProps {
98
138
  */
99
139
  'implicit-animation'?: boolean;
100
140
 
141
+ /**
142
+ * Add custom parameters to image
143
+ * @since 2.17
144
+ */
145
+ 'additional-custom-info'?: { [key: string]: string };
146
+
101
147
  /**
102
148
  * Image load success event
103
149
  * @since 0.2
@@ -111,11 +157,65 @@ export interface ImageProps extends StandardProps {
111
157
  binderror?: (e: ErrorEvent) => void;
112
158
 
113
159
  /**
114
- * Add custom parameters to image
115
- * @since 2.17
160
+ * The animation will call back when it starts playing.
161
+ * @since 2.11
116
162
  */
117
- 'additional-custom-info'?: { [key: string]: string };
163
+ bindstartplay?: (e: BaseEvent) => void;
164
+
165
+ /**
166
+ * Call back after one loop time of the animation is played.
167
+ * @since 2.11
168
+ */
169
+ bindcurrentloopcomplete?: (e: BaseEvent) => void;
170
+
171
+ /**
172
+ * 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.
173
+ * @since 2.11
174
+ */
175
+ bindfinalloopcomplete?: (e: BaseEvent) => void;
118
176
  }
119
177
 
120
178
  export type LoadEvent = BaseEvent<'load', ImageLoadEvent>;
121
179
  export type ErrorEvent = BaseEvent<'error', ImageErrorEvent>;
180
+
181
+ /**
182
+ * Restart the animation playback method controlled by the front end, and the animation playback progress and loop count will be reset.
183
+ * @Android
184
+ * @iOS
185
+ * @deprecated Deprecated. Some scenarios may not call back the call result. It is recommended to use resumeAnimation instead.
186
+ */
187
+ export interface ImageStartAnimMethod extends BaseMethod {
188
+ method: 'startAnimate';
189
+ }
190
+
191
+ /**
192
+ * Resumes the animation, without resetting the loop-count.
193
+ * @Android
194
+ * @iOS
195
+ * @since 2.11
196
+ */
197
+ export interface ImageResumeAnimMethod extends BaseMethod {
198
+ method: 'resumeAnimation';
199
+ }
200
+
201
+ /**
202
+ * Pauses the animation, without resetting the loop-count.
203
+ * @Android
204
+ * @iOS
205
+ * @since 2.11
206
+ */
207
+ export interface ImagePauseAnimMethod extends BaseMethod {
208
+ method: 'pauseAnimation';
209
+ }
210
+
211
+ /**
212
+ * Stops the animation, and it will reset the loop-count.
213
+ * @Android
214
+ * @iOS
215
+ * @since 2.11
216
+ */
217
+ export interface ImageStopAnimMethod extends BaseMethod {
218
+ method: 'stopAnimation';
219
+ }
220
+
221
+ export type ImageUIMethods = ImageStartAnimMethod | ImageResumeAnimMethod | ImagePauseAnimMethod | ImageStopAnimMethod;
@@ -81,6 +81,12 @@ export interface ListScrollInfo {
81
81
  * @iOS
82
82
  */
83
83
  eventSource: ListEventSource;
84
+ /**
85
+ * attached cells
86
+ * @iOS
87
+ * @Android
88
+ */
89
+ attachedCells: ListAttachedCell[];
84
90
  }
85
91
 
86
92
  export interface ListScrollEvent extends BaseEvent<'scroll', ListScrollInfo> {}
@@ -709,6 +715,15 @@ export interface ListProps extends StandardProps {
709
715
  */
710
716
  'needs-visible-cells'?: boolean;
711
717
 
718
+ /**
719
+ * Control whether the 'attachedCells' is included in the scroll event callback parameters on native list.
720
+ * @defaultValue false
721
+ * @Android
722
+ * @iOS
723
+ * @H
724
+ */
725
+ 'need-visible-item-info'?: boolean;
726
+
712
727
  /**
713
728
  * 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.
714
729
  * @defaultValue 200
@@ -999,16 +1014,35 @@ export interface ListItemProps extends StandardProps {
999
1014
  */
1000
1015
  'sticky-bottom'?: boolean;
1001
1016
 
1017
+ /**
1018
+ * 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.
1019
+ * @defaultValue undefined
1020
+ * @Android
1021
+ * @iOS
1022
+ */
1023
+ 'full-span'?: boolean;
1024
+
1002
1025
  /**
1003
1026
  * Preset height to control the placeholder height of the view while the list component has not finished rendering. The more accurately it is set, the less flickering the list will have.
1004
1027
  * @defaultValue undefined
1005
1028
  * @Android
1006
1029
  * @iOS
1030
+ * @deprecated For Lynx>=3.1, use {@link estimated-main-axis-size-px} instead
1007
1031
  */
1008
1032
  'estimated-height-px'?: number;
1009
1033
 
1034
+ /**
1035
+ * Preset height to control the placeholder height (in physical pixels) of the view while the list component has not finished rendering. The more accurately it is set, the less flickering the list will have.
1036
+ * @defaultValue undefined
1037
+ * @Android
1038
+ * @iOS
1039
+ * @deprecated For Lynx>=3.1, use {@link estimated-main-axis-size-px} instead
1040
+ */
1041
+ 'estimated-height'?: number;
1042
+
1010
1043
  /**
1011
1044
  * 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.
1045
+ * @since 3.1
1012
1046
  * @defaultValue undefined
1013
1047
  * @Android
1014
1048
  * @iOS
@@ -146,7 +146,7 @@ export interface BaseAnimationEvent<T> extends BaseEventOrig<{}, T> {
146
146
  };
147
147
  }
148
148
 
149
- export interface AnimationEvent extends BaseAnimationEvent<Target | MainThreadElement> {}
149
+ export interface AnimationEvent extends BaseAnimationEvent<Target> {}
150
150
 
151
151
  export interface BaseTransitionEvent<T> extends BaseEventOrig<{}, T> {
152
152
  params:
@@ -170,16 +170,31 @@ export interface BaseTransitionEvent<T> extends BaseEventOrig<{}, T> {
170
170
  | 'transition-opacity';
171
171
  };
172
172
  }
173
- export interface TransitionEvent extends BaseTransitionEvent<Target | MainThreadElement> {}
173
+ export interface TransitionEvent extends BaseTransitionEvent<Target> {}
174
174
 
175
- export interface ImageLoadEvent {
175
+ export interface BaseImageLoadEvent<T> extends BaseEventOrig<{}, T> {
176
176
  detail: {
177
177
  width: number;
178
178
  height: number;
179
179
  };
180
180
  }
181
181
 
182
- export interface ImageErrorEvent {
182
+ export interface ImageLoadEvent extends BaseImageLoadEvent<Target> {
183
+ detail: {
184
+ width: number;
185
+ height: number;
186
+ };
187
+ }
188
+
189
+ export interface BaseImageErrorEvent<T> extends BaseEventOrig<{}, T> {
190
+ detail: {
191
+ errMsg: string;
192
+ error_code: number;
193
+ lynx_categorized_code: number;
194
+ };
195
+ }
196
+
197
+ export interface ImageErrorEvent extends BaseImageErrorEvent<Target> {
183
198
  detail: {
184
199
  errMsg: string;
185
200
  error_code: number;
@@ -310,100 +325,100 @@ export interface BaseEvent<T = string, D = any> {
310
325
  detail: D;
311
326
  }
312
327
 
313
- export interface LynxEvent<Target> {
328
+ export interface LynxEvent<T> {
314
329
  /**
315
330
  * Listening for background image loading success.
316
331
  * @since since Lynx 2.6
317
332
  */
318
- BGLoad?: EventHandler<ImageLoadEvent>;
333
+ BGLoad?: EventHandler<BaseImageLoadEvent<T>>;
319
334
 
320
335
  /**
321
336
  * Failed to load background image for listening.
322
337
  * @since since: Android: Lynx 2.6, iOS: Lynx 2.8
323
338
  */
324
- BGError?: EventHandler<ImageErrorEvent>;
339
+ BGError?: EventHandler<BaseImageErrorEvent<T>>;
325
340
 
326
341
  // NodeAppear?: EventHandler<ReactLynx.AppearanceEvent>;
327
342
 
328
343
  // NodeDisappear?: EventHandler<ReactLynx.AppearanceEvent>;
329
344
 
330
345
  /** Finger touch action begins. */
331
- TouchStart?: EventHandler<BaseTouchEvent<Target>>;
346
+ TouchStart?: EventHandler<BaseTouchEvent<T>>;
332
347
 
333
348
  /** Moving after touching with fingers. */
334
- TouchMove?: EventHandler<BaseTouchEvent<Target>>;
349
+ TouchMove?: EventHandler<BaseTouchEvent<T>>;
335
350
 
336
351
  /** Finger touch actions are interrupted by incoming call reminders and pop-up windows. */
337
- TouchCancel?: EventHandler<BaseTouchEvent<Target>>;
352
+ TouchCancel?: EventHandler<BaseTouchEvent<T>>;
338
353
 
339
354
  /** Finger touch action ends. */
340
- TouchEnd?: EventHandler<BaseTouchEvent<Target>>;
355
+ TouchEnd?: EventHandler<BaseTouchEvent<T>>;
341
356
 
342
357
  /** After touching the finger, if it leaves after more than 350ms and the event callback function is specified and triggered, the tap event will not be triggered. */
343
- LongPress?: EventHandler<BaseCommonEvent<Target>>;
358
+ LongPress?: EventHandler<BaseCommonEvent<T>>;
344
359
 
345
360
  /** It will trigger during a transition animation start. */
346
- TransitionStart?: EventHandler<BaseTransitionEvent<Target>>;
361
+ TransitionStart?: EventHandler<BaseTransitionEvent<T>>;
347
362
 
348
363
  /** It will trigger when a transition animation is cancelled. */
349
- TransitionCancel?: EventHandler<BaseTransitionEvent<Target>>;
364
+ TransitionCancel?: EventHandler<BaseTransitionEvent<T>>;
350
365
 
351
366
  /** It will trigger after the transition or createAnimation animation is finished. */
352
- TransitionEnd?: EventHandler<BaseTransitionEvent<Target>>;
367
+ TransitionEnd?: EventHandler<BaseTransitionEvent<T>>;
353
368
 
354
369
  /** It will trigger at the beginning of an animation. */
355
- AnimationStart?: EventHandler<BaseAnimationEvent<Target>>;
370
+ AnimationStart?: EventHandler<BaseAnimationEvent<T>>;
356
371
 
357
372
  /** It will trigger during an animation iteration. */
358
- AnimationIteration?: EventHandler<BaseAnimationEvent<Target>>;
373
+ AnimationIteration?: EventHandler<BaseAnimationEvent<T>>;
359
374
 
360
375
  /** It will trigger when an animation is cancelled. */
361
- AnimationCancel?: EventHandler<BaseAnimationEvent<Target>>;
376
+ AnimationCancel?: EventHandler<BaseAnimationEvent<T>>;
362
377
 
363
378
  /** It will trigger upon completion of an animation. */
364
- AnimationEnd?: EventHandler<BaseAnimationEvent<Target>>;
379
+ AnimationEnd?: EventHandler<BaseAnimationEvent<T>>;
365
380
 
366
381
  /** Mouse Clicked. */
367
- MouseDown?: EventHandler<BaseMouseEvent<Target>>;
382
+ MouseDown?: EventHandler<BaseMouseEvent<T>>;
368
383
 
369
384
  /** Mouse released. */
370
- MouseUp?: EventHandler<BaseMouseEvent<Target>>;
385
+ MouseUp?: EventHandler<BaseMouseEvent<T>>;
371
386
 
372
387
  /** Mouse movement. */
373
- MouseMove?: EventHandler<BaseMouseEvent<Target>>;
388
+ MouseMove?: EventHandler<BaseMouseEvent<T>>;
374
389
 
375
390
  /** Mouse click. */
376
- MouseClick?: EventHandler<BaseMouseEvent<Target>>;
391
+ MouseClick?: EventHandler<BaseMouseEvent<T>>;
377
392
 
378
393
  /** Double-click the mouse. */
379
- MouseDblClick?: EventHandler<BaseMouseEvent<Target>>;
394
+ MouseDblClick?: EventHandler<BaseMouseEvent<T>>;
380
395
 
381
396
  /** Long press on the mouse. */
382
- MouseLongPress?: EventHandler<BaseMouseEvent<Target>>;
397
+ MouseLongPress?: EventHandler<BaseMouseEvent<T>>;
383
398
 
384
399
  /** Mouse (or touchpad) scrolling. */
385
- Wheel?: EventHandler<BaseWheelEvent<Target>>;
400
+ Wheel?: EventHandler<BaseWheelEvent<T>>;
386
401
 
387
402
  /** Keyboard (or remote control) button pressed. */
388
- KeyDown?: EventHandler<BaseKeyEvent<Target>>;
403
+ KeyDown?: EventHandler<BaseKeyEvent<T>>;
389
404
 
390
405
  /** Keyboard (or remote control) key released. */
391
- KeyUp?: EventHandler<BaseKeyEvent<Target>>;
406
+ KeyUp?: EventHandler<BaseKeyEvent<T>>;
392
407
 
393
408
  /** Element gets focus. */
394
- Focus?: EventHandler<BaseCommonEvent<Target>>;
409
+ Focus?: EventHandler<BaseCommonEvent<T>>;
395
410
 
396
411
  /** Element loses focus. */
397
- Blur?: EventHandler<BaseCommonEvent<Target>>;
412
+ Blur?: EventHandler<BaseCommonEvent<T>>;
398
413
 
399
414
  /** layout info Change event */
400
- LayoutChange?: LayoutChangeEvent;
415
+ LayoutChange?: EventHandler<LayoutChangeDetailEvent<T>>;
401
416
 
402
417
  /** UI appear event */
403
- UIAppear?: UIAppearanceEvent;
418
+ UIAppear?: EventHandler<UIAppearanceDetailEvent<T>>;
404
419
 
405
420
  /** UI disappear event */
406
- UIDisappear?: UIAppearanceEvent;
421
+ UIDisappear?: EventHandler<UIAppearanceDetailEvent<T>>;
407
422
  /**
408
423
  * The text layout event is triggered when the text layout changes.
409
424
  * @since since: Android: Lynx 2.6, iOS: Lynx 2.8
@@ -416,28 +431,27 @@ export interface LynxEvent<Target> {
416
431
  * @spec {@link https://developer.apple.com/documentation/appkit/nsaccessibility/2869551-accessibilitycustomactions/ | iOS}
417
432
  * @spec {@link https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat?hl=en#addAction(androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat) | Android}
418
433
  */
419
- AccessibilityAction?: EventHandler<AccessibilityActionDetailEvent<Target>>;
434
+ AccessibilityAction?: EventHandler<AccessibilityActionDetailEvent<T>>;
420
435
  }
421
436
 
422
- export type LayoutChangeEvent = EventHandler<LayoutChangeDetailEvent<Target>>;
423
-
424
- export type UIAppearanceEvent = EventHandler<UIAppearanceDetailEvent<Target>>;
437
+ export interface LayoutChangeEvent extends LayoutChangeDetailEvent<Target> {}
438
+ export interface UIAppearanceEvent extends UIAppearanceDetailEvent<Target> {}
425
439
 
426
440
  /**
427
441
  * This type is different with LynxEvent that they only have `bind` and `catch` event. But not `on` Event.
428
442
  */
429
- export interface LynxBindCatchEvent<Target = any> {
443
+ export interface LynxBindCatchEvent<T = any> {
430
444
  /** Immediately lift your finger after touching. */
431
- Tap?: EventHandler<BaseTouchEvent<Target>>;
445
+ Tap?: EventHandler<BaseTouchEvent<T>>;
432
446
 
433
447
  /** After touching the finger, leave after more than 350ms (it is recommended to use the longpress event instead). */
434
- LongTap?: EventHandler<BaseTouchEvent<Target>>;
448
+ LongTap?: EventHandler<BaseTouchEvent<T>>;
435
449
  }
436
450
 
437
- export type LynxEventPropsBase<Target> = {
438
- [K in keyof LynxEvent<Target> as Lowercase<`bind${K}` | `catch${K}` | `capture-bind${K}` | `capture-catch${K}` | `global-bind${K}`>]: LynxEvent<Target>[K];
451
+ export type LynxEventPropsBase<T> = {
452
+ [K in keyof LynxEvent<T> as Lowercase<`bind${K}` | `catch${K}` | `capture-bind${K}` | `capture-catch${K}` | `global-bind${K}`>]: LynxEvent<T>[K];
439
453
  } & {
440
- [K in keyof LynxBindCatchEvent<Target> as Lowercase<`bind${K}` | `catch${K}` | `capture-bind${K}` | `capture-catch${K}` | `global-bind${K}`>]: LynxBindCatchEvent<Target>[K];
454
+ [K in keyof LynxBindCatchEvent<T> as Lowercase<`bind${K}` | `catch${K}` | `capture-bind${K}` | `capture-catch${K}` | `global-bind${K}`>]: LynxBindCatchEvent<T>[K];
441
455
  };
442
456
 
443
457
  export type LynxEventProps = LynxEventPropsBase<Target>;
@@ -112,6 +112,37 @@ export interface StandardProps extends LynxEventProps {
112
112
  __lynx_timing_flag?: string;
113
113
 
114
114
  style?: string | CSSProperties;
115
+
116
+
117
+ /**
118
+ * We use CAShapeLayer to accelerate rendering of the component's backgrounds on iOS.
119
+ * @defaultValue true
120
+ * @iOS
121
+ * @since Lynx 3.1
122
+ */
123
+ 'ios-background-shape-layer'?: boolean;
124
+ 'exposure-id'?: string;
125
+ 'exposure-scene'?: string;
126
+ 'exposure-screen-margin-top'?: string;
127
+ 'exposure-screen-margin-right'?: string;
128
+ 'exposure-screen-margin-bottom'?: string;
129
+ 'exposure-screen-margin-left'?: string;
130
+ 'exposure-ui-margin-top'?: string;
131
+ 'exposure-ui-margin-right'?: string;
132
+ 'exposure-ui-margin-bottom'?: string;
133
+ 'exposure-ui-margin-left'?: string;
134
+ 'exposure-area'?: string;
135
+ 'enable-exposure-ui-margin'?: boolean;
136
+ 'user-interaction-enabled'?: boolean;
137
+ 'native-interaction-enabled'?: boolean;
138
+ 'block-native-event'?: boolean;
139
+ 'block-native-event-areas'?: number[][];
140
+ 'consume-slide-event'?: number[][];
141
+ 'event-through'?: boolean;
142
+ 'enable-touch-pseudo-propagation'?: boolean;
143
+ 'hit-slop'?: object | string;
144
+ 'ignore-focus'?: boolean;
145
+ 'ios-enable-simultaneous-touch'?: boolean;
115
146
  }
116
147
 
117
148
  export interface NoProps {
@@ -6,11 +6,20 @@ export type PlatformType = 'Android' | 'iOS';
6
6
 
7
7
  export interface SystemInfo {
8
8
  /**
9
- * The version of the Lynx SDK.
9
+ * The version of the Lynx Engine.
10
+ *
11
+ * @deprecated
10
12
  * @example '2.4', '2.10'
11
13
  */
12
14
  readonly lynxSdkVersion: string;
13
15
 
16
+ /**
17
+ * The version of the Lynx Engine.
18
+ *
19
+ * @example '3.2'
20
+ */
21
+ readonly engineVersion: string;
22
+
14
23
  /**
15
24
  * The current operating system version.
16
25
  */
@@ -2,7 +2,7 @@
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
- import { LynxEventPropsBase, BaseTouchEvent, BaseMouseEvent, BaseWheelEvent, BaseKeyEvent } from '../common/events';
5
+ import { LynxEventPropsBase, BaseTouchEvent, BaseMouseEvent, BaseWheelEvent, BaseKeyEvent, BaseAnimationEvent, BaseTransitionEvent, LayoutChangeDetailEvent, UIAppearanceDetailEvent } from '../common/events';
6
6
  import { Element } from './element';
7
7
 
8
8
  // worklet event
@@ -10,11 +10,18 @@ export interface TouchEvent extends BaseTouchEvent<Element> {}
10
10
  export interface MouseEvent extends BaseMouseEvent<Element> {}
11
11
  export interface WheelEvent extends BaseWheelEvent<Element> {}
12
12
  export interface KeyEvent extends BaseKeyEvent<Element> {}
13
+
14
+ export interface AnimationEvent extends BaseAnimationEvent<Element> {}
15
+ export interface TransitionEvent extends BaseTransitionEvent<Element> {}
16
+
17
+ export interface LayoutChangeEvent extends LayoutChangeDetailEvent<Element> {}
18
+ export interface UIAppearanceEvent extends UIAppearanceDetailEvent<Element> {}
19
+
13
20
  type LynxWorkletEventPropsImpl = {
14
21
  [K in keyof LynxEventPropsBase<Element> as Lowercase<`main-thread:${K}`>]: LynxEventPropsBase<Element>[K];
15
22
  };
16
23
  export interface LynxWorkletEventProps extends LynxWorkletEventPropsImpl {}
17
24
 
18
- declare module '../common/props.d.ts' {
25
+ declare module '../common/props' {
19
26
  interface StandardProps extends LynxWorkletEventProps {}
20
- }
27
+ }