@lynx-js/types 3.4.3 → 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 +22 -0
- package/package.json +1 -1
- package/types/background-thread/fetch.d.ts +15 -0
- package/types/background-thread/index.d.ts +1 -0
- package/types/background-thread/lynx-performance-entry.d.ts +11 -0
- package/types/background-thread/lynx.d.ts +1 -1
- package/types/background-thread/nodes-ref.d.ts +28 -12
- package/types/background-thread/text-encoder-decoder.d.ts +15 -21
- package/types/common/csstype.d.ts +103 -238
- package/types/common/element/list.d.ts +10 -0
- package/types/common/global.d.ts +2 -1
- package/types/main-thread/animation.d.ts +114 -0
- package/types/main-thread/element.d.ts +12 -0
- package/types/main-thread/index.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 3.4.11
|
|
4
|
+
- Fix types of `selectAll()` of `SelectorQuery`.
|
|
5
|
+
|
|
6
|
+
## 3.4.10
|
|
7
|
+
- Add `animate` for `MainThread.Element`
|
|
8
|
+
|
|
9
|
+
## 3.4.9
|
|
10
|
+
- Add more interface for `scroll-view`.
|
|
11
|
+
|
|
12
|
+
## 3.4.8
|
|
13
|
+
- Introduce `disabled` for input and textarea.
|
|
14
|
+
|
|
15
|
+
## 3.4.6
|
|
16
|
+
- fix `TextCodecHelper` defines.
|
|
17
|
+
- Update `fetch` defines for chunk streaming.
|
|
18
|
+
|
|
19
|
+
## 3.4.5
|
|
20
|
+
- Complete the documentation for image related APIs.
|
|
21
|
+
|
|
22
|
+
## 3.4.4
|
|
23
|
+
- Revert automatically generated cssTypes
|
|
24
|
+
|
|
3
25
|
## 3.4.3
|
|
4
26
|
- Add `font-variation-settings`,`font-feature-settings` and `font-optical-sizing` CSS properties.
|
|
5
27
|
- Add `experimental-recycle-available-item-before-layout` property for list.
|
package/package.json
CHANGED
|
@@ -74,6 +74,10 @@ export declare var Request: {
|
|
|
74
74
|
new (input: RequestInfo | URL, init?: RequestInit): Request;
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
+
export interface LynxExtension {
|
|
78
|
+
useStreaming?: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
77
81
|
/**
|
|
78
82
|
* @description This Fetch API interface represents the response to a request.
|
|
79
83
|
* @see https://developer.mozilla.org/docs/Web/API/Response
|
|
@@ -95,6 +99,11 @@ export interface RequestInit {
|
|
|
95
99
|
* @since 2.18
|
|
96
100
|
*/
|
|
97
101
|
method?: string;
|
|
102
|
+
/**
|
|
103
|
+
* @description Lynx extension, currently used for requesting chunk streaming
|
|
104
|
+
* @since 3.4
|
|
105
|
+
*/
|
|
106
|
+
lynxExtension?: LynxExtension;
|
|
98
107
|
}
|
|
99
108
|
|
|
100
109
|
/**
|
|
@@ -133,6 +142,12 @@ export interface Response extends Body {
|
|
|
133
142
|
* @since 2.18
|
|
134
143
|
*/
|
|
135
144
|
readonly url: string;
|
|
145
|
+
/**
|
|
146
|
+
* @description body of ReadableStream
|
|
147
|
+
* @see https://developer.mozilla.org/docs/Web/API/Response/body
|
|
148
|
+
* @since 3.4
|
|
149
|
+
*/
|
|
150
|
+
readonly body: ReadableStream;
|
|
136
151
|
/**
|
|
137
152
|
* @description clone()
|
|
138
153
|
* @see https://developer.mozilla.org/docs/Web/API/Response/clone
|
|
@@ -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;
|
|
@@ -7,7 +7,7 @@ import { AnimationElement } from './animation';
|
|
|
7
7
|
import { BeforePublishEvent, GlobalEventEmitter, IntersectionObserver } from './event';
|
|
8
8
|
import { SelectorQuery } from './nodes-ref';
|
|
9
9
|
import { Performance } from './performance';
|
|
10
|
-
import { Response } from './fetch';
|
|
10
|
+
import { Response, RequestInit } from './fetch';
|
|
11
11
|
|
|
12
12
|
export * from './fetch';
|
|
13
13
|
|
|
@@ -58,9 +58,21 @@ export interface FieldsData {
|
|
|
58
58
|
attribute: Record<string, unknown>;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export type PathCallback = (data: PathData, status: { data: string; code: number }) => void;
|
|
61
|
+
export type PathCallback = (data: PathData | null, status: { data: string; code: number }) => void;
|
|
62
62
|
|
|
63
|
-
|
|
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 {
|
|
64
76
|
invoke(options: uiMethodOptions): SelectorQuery;
|
|
65
77
|
|
|
66
78
|
path(callback: PathCallback): SelectorQuery;
|
|
@@ -70,20 +82,24 @@ export interface NodesRef {
|
|
|
70
82
|
callback: (
|
|
71
83
|
data: {
|
|
72
84
|
[K in keyof Required<FieldsParams> as T[K] extends true ? K : never]: FieldsData[K];
|
|
73
|
-
},
|
|
85
|
+
} | null,
|
|
74
86
|
status: { data: string; code: number }
|
|
75
87
|
) => void
|
|
76
88
|
): SelectorQuery;
|
|
89
|
+
}
|
|
77
90
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
playAnimation(ids: string[] | string): SelectorQuery;
|
|
81
|
-
|
|
82
|
-
pauseAnimation(ids: string[] | string): SelectorQuery;
|
|
91
|
+
export interface MultiNodesRef extends BaseNodesRef {
|
|
92
|
+
path(callback: (data: PathData[], status: { data: string; code: number }) => void): SelectorQuery;
|
|
83
93
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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;
|
|
87
103
|
}
|
|
88
104
|
|
|
89
105
|
export interface SelectorQuery {
|
|
@@ -97,7 +113,7 @@ export interface SelectorQuery {
|
|
|
97
113
|
* Selects all nodes satisfying CSS selector.
|
|
98
114
|
* @param selector CSS selector
|
|
99
115
|
*/
|
|
100
|
-
selectAll(selector: string):
|
|
116
|
+
selectAll(selector: string): MultiNodesRef;
|
|
101
117
|
|
|
102
118
|
/**
|
|
103
119
|
* Select root node of the component.
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
type TypedArray =
|
|
7
|
-
| Int8Array
|
|
8
|
-
| Uint8Array
|
|
9
|
-
| Uint8ClampedArray
|
|
10
|
-
| Int16Array
|
|
11
|
-
| Uint16Array
|
|
12
|
-
| Int32Array
|
|
13
|
-
| Uint32Array
|
|
14
|
-
| Float32Array
|
|
15
|
-
| Float64Array;
|
|
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.
|
|
16
4
|
|
|
17
|
-
export interface
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
export interface ITextCodecHelper {
|
|
6
|
+
/**
|
|
7
|
+
* @description decode array buffer to string
|
|
8
|
+
* @since 3.4
|
|
9
|
+
*/
|
|
10
|
+
decode(input: ArrayBuffer): string;
|
|
11
|
+
/**
|
|
12
|
+
* @description encode string to array buffer
|
|
13
|
+
* @since 3.4
|
|
14
|
+
*/
|
|
15
|
+
encode(input: string): ArrayBuffer;
|
|
16
|
+
}
|
|
@@ -2,244 +2,106 @@
|
|
|
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
|
-
|
|
6
|
-
* This file is auto-generated from CSS define files in the css_defines directory.
|
|
7
|
-
* Each property's type is determined by:
|
|
8
|
-
* 1. For enum types: Uses the values array from the CSS define file
|
|
9
|
-
* 2. For properties with keywords: Uses the keywords array as enum values, with (string & {}) for open-ended types
|
|
10
|
-
* 3. For other types: Uses string type
|
|
11
|
-
*/
|
|
5
|
+
import * as CSS from 'csstype';
|
|
12
6
|
|
|
13
|
-
export type
|
|
14
|
-
// layout
|
|
15
|
-
flexFlow?: string;
|
|
16
|
-
marginInlineStart?: string;
|
|
17
|
-
marginInlineEnd?: string;
|
|
18
|
-
paddingInlineStart?: string;
|
|
19
|
-
paddingInlineEnd?: string;
|
|
20
|
-
gridTemplateColumns?: string;
|
|
21
|
-
gridTemplateRows?: string;
|
|
22
|
-
gridAutoColumns?: string;
|
|
23
|
-
gridAutoRows?: string;
|
|
24
|
-
gridColumnSpan?: number;
|
|
25
|
-
gridRowSpan?: number;
|
|
26
|
-
gridColumnStart?: string;
|
|
27
|
-
gridColumnEnd?: string;
|
|
28
|
-
gridRowStart?: string;
|
|
29
|
-
gridRowEnd?: string;
|
|
30
|
-
gridColumnGap?: string;
|
|
31
|
-
gridRowGap?: string;
|
|
32
|
-
gridAutoFlow?: 'row' | 'column' | 'dense' | 'row dense' | 'column dense';
|
|
33
|
-
maskPosition?: string;
|
|
34
|
-
display?: 'none' | 'flex' | 'grid' | 'linear' | 'relative' | 'block' | 'auto';
|
|
35
|
-
padding?: string;
|
|
36
|
-
paddingLeft?: string;
|
|
37
|
-
paddingRight?: string;
|
|
38
|
-
paddingTop?: string;
|
|
39
|
-
paddingBottom?: string;
|
|
40
|
-
margin?: string;
|
|
41
|
-
marginLeft?: string;
|
|
42
|
-
marginRight?: string;
|
|
43
|
-
marginTop?: string;
|
|
44
|
-
marginBottom?: string;
|
|
45
|
-
flex?: string;
|
|
46
|
-
position?: 'absolute' | 'relative' | 'fixed' | 'sticky';
|
|
47
|
-
flexGrow?: number;
|
|
48
|
-
flexShrink?: number;
|
|
49
|
-
flexBasis?: string;
|
|
50
|
-
flexDirection?: 'column' | 'row' | 'row-reverse' | 'column-reverse';
|
|
51
|
-
flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
|
|
52
|
-
backgroundPosition?: string;
|
|
53
|
-
|
|
54
|
-
// typography
|
|
55
|
-
outline?: string;
|
|
56
|
-
outlineColor?: string;
|
|
57
|
-
outlineStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
58
|
-
outlineWidth?: string;
|
|
59
|
-
textDecorationColor?: string;
|
|
60
|
-
linearCrossGravity?: 'none' | 'start' | 'end' | 'center' | 'stretch';
|
|
61
|
-
borderInlineStartColor?: string;
|
|
62
|
-
borderInlineEndColor?: string;
|
|
63
|
-
borderInlineStartWidth?: string;
|
|
64
|
-
borderInlineEndWidth?: string;
|
|
65
|
-
borderInlineStartStyle?: string;
|
|
66
|
-
borderInlineEndStyle?: string;
|
|
67
|
-
relativeAlignInlineStart?: string;
|
|
68
|
-
relativeAlignInlineEnd?: string;
|
|
69
|
-
relativeInlineStartOf?: number;
|
|
70
|
-
relativeInlineEndOf?: number;
|
|
71
|
-
insetInlineStart?: string;
|
|
72
|
-
insetInlineEnd?: string;
|
|
73
|
-
linearDirection?: string;
|
|
74
|
-
textIndent?: string;
|
|
75
|
-
textStroke?: string;
|
|
76
|
-
textStrokeWidth?: string;
|
|
77
|
-
textStrokeColor?: string;
|
|
78
|
-
XAutoFontSize?: string;
|
|
79
|
-
XAutoFontSizePresetSizes?: string;
|
|
80
|
-
fontVariationSettings?: string;
|
|
81
|
-
fontFeatureSettings?: string;
|
|
82
|
-
fontOpticalSizing?: 'none' | 'auto';
|
|
83
|
-
textAlign?: 'left' | 'center' | 'right' | 'start' | 'end' | 'justify';
|
|
84
|
-
lineHeight?: string;
|
|
85
|
-
textOverflow?: 'clip' | 'ellipsis';
|
|
86
|
-
fontSize?: string;
|
|
87
|
-
fontWeight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
88
|
-
fontFamily?: string;
|
|
89
|
-
fontStyle?: 'normal' | 'italic' | 'oblique';
|
|
90
|
-
lineSpacing?: string;
|
|
91
|
-
linearOrientation?: 'horizontal' | 'vertical' | 'horizontal-reverse' | 'vertical-reverse' | 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
92
|
-
linearWeightSum?: number;
|
|
93
|
-
linearWeight?: number;
|
|
94
|
-
linearGravity?: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'center-vertical' | 'center-horizontal' | 'space-between' | 'start' | 'end' | 'center';
|
|
95
|
-
linearLayoutGravity?: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'center-vertical' | 'center-horizontal' | 'fill-vertical' | 'fill-horizontal' | 'center' | 'stretch' | 'start' | 'end';
|
|
96
|
-
adaptFontSize?: string;
|
|
97
|
-
textDecoration?: 'none' | 'underline' | 'line-through' | (string & {});
|
|
98
|
-
textShadow?: string;
|
|
99
|
-
|
|
100
|
-
// visual
|
|
101
|
-
borderTopColor?: string;
|
|
102
|
-
backgroundOrigin?: 'border-box' | 'content-box' | 'padding-box';
|
|
103
|
-
backgroundRepeat?: 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat' | 'round' | 'space';
|
|
104
|
-
backgroundSize?: string;
|
|
105
|
-
border?: string;
|
|
106
|
-
borderRight?: string;
|
|
107
|
-
borderLeft?: string;
|
|
108
|
-
borderTop?: string;
|
|
109
|
-
borderBottom?: string;
|
|
110
|
-
borderBottomColor?: string;
|
|
111
|
-
borderLeftStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
112
|
-
borderRightStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
113
|
-
borderTopStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
114
|
-
borderBottomStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
115
|
-
borderRadius?: string;
|
|
116
|
-
backgroundClip?: 'border-box' | 'content-box' | 'padding-box' | 'text';
|
|
117
|
-
caretColor?: string;
|
|
118
|
-
borderTopLeftRadius?: string;
|
|
119
|
-
borderBottomLeftRadius?: string;
|
|
120
|
-
borderTopRightRadius?: string;
|
|
121
|
-
borderBottomRightRadius?: string;
|
|
122
|
-
borderStartStartRadius?: string;
|
|
123
|
-
borderEndStartRadius?: string;
|
|
124
|
-
borderStartEndRadius?: string;
|
|
125
|
-
borderEndEndRadius?: string;
|
|
126
|
-
borderWidth?: string;
|
|
127
|
-
borderLeftWidth?: string;
|
|
128
|
-
borderRightWidth?: string;
|
|
129
|
-
borderTopWidth?: string;
|
|
130
|
-
borderBottomWidth?: string;
|
|
131
|
-
XAnimationColorInterpolation?: 'auto' | 'sRGB' | 'linearRGB';
|
|
132
|
-
XHandleColor?: string;
|
|
133
|
-
color?: string;
|
|
134
|
-
background?: string;
|
|
135
|
-
borderColor?: string;
|
|
136
|
-
backgroundColor?: string;
|
|
137
|
-
borderStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
138
|
-
borderLeftColor?: string;
|
|
139
|
-
borderRightColor?: string;
|
|
140
|
-
backgroundImage?: string;
|
|
141
|
-
|
|
142
|
-
// animation
|
|
143
|
-
transition?: string;
|
|
144
|
-
transitionProperty?: 'none' | 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | 'width' | 'height' | 'background-color' | 'visibility' | 'left' | 'top' | 'right' | 'bottom' | 'transform' | 'all' | (string & {});
|
|
145
|
-
transitionDuration?: string;
|
|
146
|
-
transitionDelay?: string;
|
|
147
|
-
transitionTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
148
|
-
implicitAnimation?: string;
|
|
149
|
-
enterTransitionName?: string;
|
|
150
|
-
exitTransitionName?: string;
|
|
151
|
-
pauseTransitionName?: string;
|
|
152
|
-
resumeTransitionName?: string;
|
|
153
|
-
animation?: string;
|
|
154
|
-
animationName?: string;
|
|
155
|
-
animationDuration?: string;
|
|
156
|
-
animationTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
157
|
-
animationDelay?: string;
|
|
158
|
-
animationIterationCount?: string;
|
|
159
|
-
animationDirection?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';
|
|
160
|
-
animationFillMode?: 'none' | 'forwards' | 'backwards' | 'both';
|
|
161
|
-
animationPlayState?: 'paused' | 'running';
|
|
162
|
-
layoutAnimationCreateDuration?: string;
|
|
163
|
-
layoutAnimationCreateTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
164
|
-
layoutAnimationCreateDelay?: string;
|
|
165
|
-
layoutAnimationCreateProperty?: 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | (string & {});
|
|
166
|
-
layoutAnimationDeleteDuration?: string;
|
|
167
|
-
layoutAnimationDeleteTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
168
|
-
layoutAnimationDeleteDelay?: string;
|
|
169
|
-
layoutAnimationDeleteProperty?: 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | (string & {});
|
|
170
|
-
layoutAnimationUpdateDuration?: string;
|
|
171
|
-
layoutAnimationUpdateTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
172
|
-
layoutAnimationUpdateDelay?: string;
|
|
7
|
+
export type Modify<T, R> = Omit<T, keyof R> & R;
|
|
173
8
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
9
|
+
export type CSSProperties = Modify<
|
|
10
|
+
CSS.Properties<string | number>,
|
|
11
|
+
{
|
|
12
|
+
position?: 'absolute' | 'relative' | 'fixed' | 'sticky';
|
|
13
|
+
boxSizing?: 'border-box' | 'content-box' | 'auto';
|
|
14
|
+
display?: 'none' | 'flex' | 'grid' | 'linear' | 'relative' | 'block' | 'auto';
|
|
15
|
+
overflow?: 'hidden' | 'visible' | (string & {});
|
|
16
|
+
whiteSpace?: 'normal' | 'nowrap';
|
|
17
|
+
textAlign?: 'left' | 'center' | 'right' | 'start' | 'end';
|
|
18
|
+
textOverflow?: 'clip' | 'ellipsis';
|
|
19
|
+
fontWeight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
20
|
+
flexDirection?: 'column' | 'row' | 'row-reverse' | 'column-reverse';
|
|
21
|
+
flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
|
|
22
|
+
alignContent?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around' | 'start' | 'end';
|
|
23
|
+
justifyContent?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'start' | 'end';
|
|
24
|
+
fontStyle?: 'normal' | 'italic' | 'oblique';
|
|
25
|
+
transform?:
|
|
26
|
+
| 'translate'
|
|
27
|
+
| 'translateX'
|
|
28
|
+
| 'translateY'
|
|
29
|
+
| 'translateZ'
|
|
30
|
+
| 'translate'
|
|
31
|
+
| 'translate3d'
|
|
32
|
+
| 'translate3D'
|
|
33
|
+
| 'rotate'
|
|
34
|
+
| 'rotateX'
|
|
35
|
+
| 'rotateY'
|
|
36
|
+
| 'rotateZ'
|
|
37
|
+
| 'scale'
|
|
38
|
+
| 'scaleX'
|
|
39
|
+
| 'scaleY'
|
|
40
|
+
| (string & {});
|
|
41
|
+
animationTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
42
|
+
borderStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
43
|
+
transformOrigin?: 'left' | 'right' | 'top' | 'bottom' | 'center' | (string & {});
|
|
44
|
+
linearDirection?: 'column' | 'row' | 'column-reverse' | 'row-reverse';
|
|
45
|
+
linearOrientation?: 'horizontal' | 'vertical' | 'horizontal-reverse' | 'vertical-reverse';
|
|
46
|
+
linearWeight?: number;
|
|
47
|
+
linearGravity?: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'center-vertical' | 'center-horizontal' | 'space-between' | 'start' | 'end' | 'center';
|
|
48
|
+
linearLayoutGravity?:
|
|
49
|
+
| 'none'
|
|
50
|
+
| 'top'
|
|
51
|
+
| 'bottom'
|
|
52
|
+
| 'left'
|
|
53
|
+
| 'right'
|
|
54
|
+
| 'center-vertical'
|
|
55
|
+
| 'center-horizontal'
|
|
56
|
+
| 'fill-vertical'
|
|
57
|
+
| 'fill-horizontal'
|
|
58
|
+
| 'center'
|
|
59
|
+
| 'stretch'
|
|
60
|
+
| 'start'
|
|
61
|
+
| 'end';
|
|
62
|
+
layoutAnimationCreateTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
63
|
+
layoutAnimationCreateProperty?: 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | (string & {});
|
|
64
|
+
layoutAnimationDeleteTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
65
|
+
layoutAnimationDeleteProperty?: 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | (string & {});
|
|
66
|
+
layoutAnimationUpdateTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
67
|
+
textDecoration?: 'none' | 'underline' | 'line-through' | (string & {});
|
|
68
|
+
visibility?: 'hidden' | 'visible' | 'none' | 'collapse';
|
|
69
|
+
transitionProperty?:
|
|
70
|
+
| 'none'
|
|
71
|
+
| 'opacity'
|
|
72
|
+
| 'scaleX'
|
|
73
|
+
| 'scaleY'
|
|
74
|
+
| 'scaleXY'
|
|
75
|
+
| 'width'
|
|
76
|
+
| 'height'
|
|
77
|
+
| 'background-color'
|
|
78
|
+
| 'visibility'
|
|
79
|
+
| 'left'
|
|
80
|
+
| 'top'
|
|
81
|
+
| 'right'
|
|
82
|
+
| 'bottom'
|
|
83
|
+
| 'transform'
|
|
84
|
+
| 'all'
|
|
85
|
+
| (string & {});
|
|
86
|
+
transitionTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
87
|
+
borderLeftStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
88
|
+
borderRightStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
89
|
+
borderTopStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
90
|
+
borderBottomStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
91
|
+
overflowX?: 'hidden' | 'visible' | (string & {});
|
|
92
|
+
overflowY?: 'hidden' | 'visible' | (string & {});
|
|
93
|
+
wordBreak?: 'normal' | 'break-all' | 'keep-all';
|
|
94
|
+
outlineStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
95
|
+
verticalAlign?: 'baseline' | 'sub' | 'super' | 'top' | 'text-top' | 'middle' | 'bottom' | 'text-bottom' | (string & {});
|
|
96
|
+
direction?: 'normal' | 'lynx-rtl' | 'rtl' | 'ltr';
|
|
97
|
+
relativeCenter?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
98
|
+
linearCrossGravity?: 'none' | 'start' | 'end' | 'center' | 'stretch';
|
|
99
|
+
listMainAxisGap?: 'grayscale' | (string & {});
|
|
100
|
+
fontVariationSettings?: string;
|
|
101
|
+
fontFeatureSettings?: string;
|
|
102
|
+
fontOpticalSizing?: 'none' | 'auto';
|
|
103
|
+
}
|
|
104
|
+
>;
|
|
243
105
|
|
|
244
106
|
export type Shorthands =
|
|
245
107
|
// layout
|
|
@@ -264,5 +126,8 @@ export type Longhands =
|
|
|
264
126
|
// other
|
|
265
127
|
"top" | "visibility" | "content" | "overflowX" | "overflowY" | "wordBreak" | "verticalAlign" | "direction" | "relativeId" | "relativeAlignTop" | "relativeAlignRight" | "relativeAlignBottom" | "relativeAlignLeft" | "relativeTopOf" | "relativeRightOf" | "relativeBottomOf" | "relativeLeftOf" | "relativeLayoutOnce" | "relativeCenter" | "zIndex" | "maskImage" | "justifyItems" | "justifySelf" | "filter" | "listMainAxisGap" | "listCrossAxisGap" | "perspective" | "cursor" | "clipPath" | "left" | "maskRepeat" | "maskClip" | "maskOrigin" | "maskSize" | "columnGap" | "rowGap" | "imageRendering" | "hyphens" | "XAppRegion" | "XHandleSize" | "offsetDistance" | "offsetPath" | "offsetRotate" | "opacity" | "height" | "width" | "maxWidth" | "minWidth" | "right" | "maxHeight" | "minHeight" | "bottom" | "letterSpacing" | "alignItems" | "alignSelf" | "alignContent" | "justifyContent" | "boxSizing" | "transform" | "order" | "boxShadow" | "transformOrigin" | "aspectRatio";
|
|
266
128
|
|
|
267
|
-
|
|
268
|
-
|
|
129
|
+
// Since `Shorthands` and `Longhands` are auto generated, there may be properties
|
|
130
|
+
// such as `gridColumnSpan` is not manually defined in `CSSProperties` yet.
|
|
131
|
+
// Use `& keyof CSSProperties` to ensure only the defined keys are included to avoid type error.
|
|
132
|
+
export type CSSPropertiesWithShorthands = Pick<CSSProperties, Shorthands & keyof CSSProperties>;
|
|
133
|
+
export type CSSPropertiesWithLonghands = Pick<CSSProperties, Longhands & keyof CSSProperties>;
|
|
@@ -1095,6 +1095,16 @@ export interface ListItemProps extends StandardProps {
|
|
|
1095
1095
|
*/
|
|
1096
1096
|
'item-key': string;
|
|
1097
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
|
+
|
|
1098
1108
|
bindnodeappear?: EventHandler<AppearanceEvent>;
|
|
1099
1109
|
bindnodedisappear?: EventHandler<AppearanceEvent>;
|
|
1100
1110
|
}
|
package/types/common/global.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
5
|
import { SystemInfo } from './system-info';
|
|
6
|
-
import { Lynx as BackgroundLynx, NativeModules as INativeModules, GetElementByIdFunc } from '../background-thread';
|
|
6
|
+
import { Lynx as BackgroundLynx, NativeModules as INativeModules, GetElementByIdFunc, ITextCodecHelper } from '../background-thread';
|
|
7
7
|
import { Lynx as MainThreadLynx } from '../main-thread';
|
|
8
8
|
import { CommonLynx } from './lynx';
|
|
9
9
|
|
|
@@ -25,6 +25,7 @@ declare global {
|
|
|
25
25
|
var getElementById: GetElementByIdFunc;
|
|
26
26
|
|
|
27
27
|
var NativeModules: INativeModules;
|
|
28
|
+
var TextCodecHelper: ITextCodecHelper;
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* @description requestAnimationFrame
|
|
@@ -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,6 +3,7 @@
|
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
5
|
import { CSSProperties } from '../common';
|
|
6
|
+
import { Animation, AnimationOptions } from './animation'
|
|
6
7
|
|
|
7
8
|
export interface Element {
|
|
8
9
|
styles: CSSProperties;
|
|
@@ -82,4 +83,15 @@ export interface Element {
|
|
|
82
83
|
* @since Lynx 2.14
|
|
83
84
|
*/
|
|
84
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;
|
|
85
97
|
}
|