@lynx-js/types 3.3.0 → 3.3.1

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,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.3.1
4
+
5
+ - [Infra][Types] Codegen csstype.d.ts from css_defines
6
+
3
7
  ## 3.3.0
4
8
 
5
9
  ### Major Changes
@@ -12,6 +16,7 @@
12
16
  - Add some missing types of built-in element `list`
13
17
  - Add some missing types of built-in element `image`
14
18
  - Add more events like `LayoutChangeEvent` into `MainThread` namespace
19
+ - Add animate operate function in selectorQuery
15
20
 
16
21
  In this commit, we add `AnimationEvent`, `TransitionEvent`, `LayoutChangeEvent`, `UIAppearanceEvent` into `MainThread` namespace.
17
22
  Now you can use like this:
package/package.json CHANGED
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "name": "@lynx-js/types",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "",
5
- "keywords": ["lynx" , "types"],
5
+ "keywords": [
6
+ "lynx",
7
+ "types"
8
+ ],
6
9
  "license": "Apache-2.0",
7
10
  "author": "Lynx Authors",
8
- "types":"types/index.d.ts",
11
+ "types": "types/index.d.ts",
9
12
  "main": "types/index.d.ts",
10
13
  "scripts": {
11
- "test": "vitest --typecheck --run & tsc --noEmit"
14
+ "test": "vitest --typecheck --run && tsc --noEmit"
12
15
  },
13
16
  "exports": {
14
17
  ".": {
@@ -38,11 +41,21 @@
38
41
  "background": [
39
42
  "./types/background-thread/index.d.ts"
40
43
  ],
41
- "common": ["./types/common/index.d.ts"],
42
- "element": ["./types/common/element/index.d.ts"],
43
- "events": ["./types/common/events.d.ts"],
44
- "props": ["./types/common/props.d.ts"],
45
- "main-thread": ["./types/main-thread/index.d.ts"]
44
+ "common": [
45
+ "./types/common/index.d.ts"
46
+ ],
47
+ "element": [
48
+ "./types/common/element/index.d.ts"
49
+ ],
50
+ "events": [
51
+ "./types/common/events.d.ts"
52
+ ],
53
+ "props": [
54
+ "./types/common/props.d.ts"
55
+ ],
56
+ "main-thread": [
57
+ "./types/main-thread/index.d.ts"
58
+ ]
46
59
  }
47
60
  },
48
61
  "files": [
@@ -45,3 +45,13 @@ export interface Animation {
45
45
 
46
46
  play(): void;
47
47
  }
48
+
49
+ export interface KeyframeEffectV2 {
50
+ readonly keyframes: Array<Record<string, any>>;
51
+ readonly options: Record<string, any>;
52
+ }
53
+
54
+ export interface AnimationV2 {
55
+ readonly effect: KeyframeEffectV2;
56
+ readonly id: string;
57
+ }
@@ -7,12 +7,12 @@ export interface PerformanceEntry {
7
7
  }
8
8
 
9
9
  export interface FrameworkRenderingTiming {
10
- vmExecuteStart?: number;
11
- vmExecuteEnd?: number;
12
- dataProcessorStart?: number;
13
- dataProcessorEnd?: number;
14
- setInitDataStart?: number;
15
- setInitDataEnd?: number;
10
+ vmExecuteStart: number;
11
+ vmExecuteEnd: number;
12
+ dataProcessorStart: number;
13
+ dataProcessorEnd: number;
14
+ setInitDataStart: number;
15
+ setInitDataEnd: number;
16
16
  }
17
17
 
18
18
  export interface FrameworkRenderingTimings {
@@ -43,6 +43,10 @@ export interface LoadBundleEntry extends PipelineEntry {
43
43
  parseEnd: number;
44
44
  loadBackgroundStart: number;
45
45
  loadBackgroundEnd: number;
46
+ verifyTasmStart: number;
47
+ verifyTasmEnd: number;
48
+ ffiStart: number;
49
+ ffiEnd: number;
46
50
  }
47
51
 
48
52
  export interface InitContainerEntry extends PerformanceEntry {
@@ -79,12 +83,6 @@ export interface MetricFcpEntry extends PerformanceEntry {
79
83
  totalFcp: PerformanceMetric;
80
84
  }
81
85
 
82
- export interface MetricTtiEntry extends PerformanceEntry {
83
- tti: PerformanceMetric;
84
- lynxTti: PerformanceMetric;
85
- totalTti: PerformanceMetric;
86
- }
87
-
88
86
  export interface MetricActualFmpEntry extends PerformanceEntry {
89
87
  actualFmp: PerformanceMetric;
90
88
  lynxActualFmp: PerformanceMetric;
@@ -3,6 +3,7 @@
3
3
  // LICENSE file in the root directory of this source tree.
4
4
 
5
5
  import { AnyObject } from '../common';
6
+ import { AnimationV2 } from './animation';
6
7
 
7
8
  export enum NODE_REF_INVOKE_ERROR_CODE {
8
9
  SUCCESS = 0,
@@ -74,6 +75,14 @@ export interface NodesRef {
74
75
  ) => void
75
76
  ): SelectorQuery;
76
77
 
78
+ animate(animations: AnimationV2[] | AnimationV2): SelectorQuery;
79
+
80
+ playAnimation(ids: string[] | string): SelectorQuery;
81
+
82
+ pauseAnimation(ids: string[] | string): SelectorQuery;
83
+
84
+ cancelAnimation(ids: string[] | string): SelectorQuery;
85
+
77
86
  setNativeProps(nativeProps: Record<string, any>): SelectorQuery;
78
87
  }
79
88
 
@@ -2,100 +2,242 @@
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 * as CSS from 'csstype';
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
+ */
12
+
13
+ import type * as CSS from 'csstype';
6
14
 
7
15
  export type Modify<T, R> = Omit<T, keyof R> & R;
8
16
 
9
17
  export type CSSProperties = Modify<
10
18
  CSS.Properties<string | number>,
11
19
  {
12
- position?: 'absolute' | 'relative' | 'fixed' | 'sticky';
13
- boxSizing?: 'border-box' | 'content-box' | 'auto';
20
+ // layout
21
+ flexFlow?: string;
22
+ marginInlineStart?: string;
23
+ marginInlineEnd?: string;
24
+ paddingInlineStart?: string;
25
+ paddingInlineEnd?: string;
26
+ gridTemplateColumns?: string;
27
+ gridTemplateRows?: string;
28
+ gridAutoColumns?: string;
29
+ gridAutoRows?: string;
30
+ gridColumnSpan?: number;
31
+ gridRowSpan?: number;
32
+ gridColumnStart?: string;
33
+ gridColumnEnd?: string;
34
+ gridRowStart?: string;
35
+ gridRowEnd?: string;
36
+ gridColumnGap?: string;
37
+ gridRowGap?: string;
38
+ gridAutoFlow?: 'row' | 'column' | 'dense' | 'row dense' | 'column dense';
39
+ maskPosition?: string;
14
40
  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';
41
+ padding?: string;
42
+ paddingLeft?: string;
43
+ paddingRight?: string;
44
+ paddingTop?: string;
45
+ paddingBottom?: string;
46
+ margin?: string;
47
+ marginLeft?: string;
48
+ marginRight?: string;
49
+ marginTop?: string;
50
+ marginBottom?: string;
51
+ flex?: string;
52
+ position?: 'absolute' | 'relative' | 'fixed' | 'sticky';
53
+ flexGrow?: number;
54
+ flexShrink?: number;
55
+ flexBasis?: string;
20
56
  flexDirection?: 'column' | 'row' | 'row-reverse' | 'column-reverse';
21
57
  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';
58
+ backgroundPosition?: string;
59
+
60
+ // typography
61
+ outline?: string;
62
+ outlineColor?: string;
63
+ outlineStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
64
+ outlineWidth?: string;
65
+ textDecorationColor?: string;
66
+ linearCrossGravity?: 'none' | 'start' | 'end' | 'center' | 'stretch';
67
+ borderInlineStartColor?: string;
68
+ borderInlineEndColor?: string;
69
+ borderInlineStartWidth?: string;
70
+ borderInlineEndWidth?: string;
71
+ borderInlineStartStyle?: string;
72
+ borderInlineEndStyle?: string;
73
+ relativeAlignInlineStart?: string;
74
+ relativeAlignInlineEnd?: string;
75
+ relativeInlineStartOf?: number;
76
+ relativeInlineEndOf?: number;
77
+ insetInlineStart?: string;
78
+ insetInlineEnd?: string;
79
+ linearDirection?: string;
80
+ textIndent?: string;
81
+ textStroke?: string;
82
+ textStrokeWidth?: string;
83
+ textStrokeColor?: string;
84
+ XAutoFontSize?: string;
85
+ XAutoFontSizePresetSizes?: string;
86
+ textAlign?: 'left' | 'center' | 'right' | 'start' | 'end' | 'justify';
87
+ lineHeight?: string;
88
+ textOverflow?: 'clip' | 'ellipsis';
89
+ fontSize?: string;
90
+ fontWeight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
91
+ fontFamily?: string;
24
92
  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';
93
+ lineSpacing?: string;
94
+ linearOrientation?: 'horizontal' | 'vertical' | 'horizontal-reverse' | 'vertical-reverse' | 'row' | 'column' | 'row-reverse' | 'column-reverse';
95
+ linearWeightSum?: number;
46
96
  linearWeight?: number;
47
97
  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';
98
+ linearLayoutGravity?: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'center-vertical' | 'center-horizontal' | 'fill-vertical' | 'fill-horizontal' | 'center' | 'stretch' | 'start' | 'end';
99
+ adaptFontSize?: string;
100
+ textDecoration?: 'none' | 'underline' | 'line-through' | (string & {});
101
+ textShadow?: string;
102
+
103
+ // visual
104
+ borderTopColor?: string;
105
+ backgroundOrigin?: 'border-box' | 'content-box' | 'padding-box';
106
+ backgroundRepeat?: 'no-repeat' | 'repeat-x' | 'repeat-y' | 'repeat' | 'round' | 'space';
107
+ backgroundSize?: string;
108
+ border?: string;
109
+ borderRight?: string;
110
+ borderLeft?: string;
111
+ borderTop?: string;
112
+ borderBottom?: string;
113
+ borderBottomColor?: string;
114
+ borderLeftStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
115
+ borderRightStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
116
+ borderTopStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
117
+ borderBottomStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
118
+ borderRadius?: string;
119
+ backgroundClip?: 'border-box' | 'content-box' | 'padding-box' | 'text';
120
+ caretColor?: string;
121
+ borderTopLeftRadius?: string;
122
+ borderBottomLeftRadius?: string;
123
+ borderTopRightRadius?: string;
124
+ borderBottomRightRadius?: string;
125
+ borderStartStartRadius?: string;
126
+ borderEndStartRadius?: string;
127
+ borderStartEndRadius?: string;
128
+ borderEndEndRadius?: string;
129
+ borderWidth?: string;
130
+ borderLeftWidth?: string;
131
+ borderRightWidth?: string;
132
+ borderTopWidth?: string;
133
+ borderBottomWidth?: string;
134
+ XAnimationColorInterpolation?: 'auto' | 'sRGB' | 'linearRGB';
135
+ XHandleColor?: string;
136
+ color?: string;
137
+ background?: string;
138
+ borderColor?: string;
139
+ backgroundColor?: string;
140
+ borderStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
141
+ borderLeftColor?: string;
142
+ borderRightColor?: string;
143
+ backgroundImage?: string;
144
+
145
+ // animation
146
+ transition?: string;
147
+ transitionProperty?: 'none' | 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | 'width' | 'height' | 'background-color' | 'visibility' | 'left' | 'top' | 'right' | 'bottom' | 'transform' | 'all' | (string & {});
148
+ transitionDuration?: string;
149
+ transitionDelay?: string;
150
+ transitionTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
151
+ implicitAnimation?: string;
152
+ enterTransitionName?: string;
153
+ exitTransitionName?: string;
154
+ pauseTransitionName?: string;
155
+ resumeTransitionName?: string;
156
+ animation?: string;
157
+ animationName?: string;
158
+ animationDuration?: string;
159
+ animationTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
160
+ animationDelay?: string;
161
+ animationIterationCount?: string;
162
+ animationDirection?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';
163
+ animationFillMode?: 'none' | 'forwards' | 'backwards' | 'both';
164
+ animationPlayState?: 'paused' | 'running';
165
+ layoutAnimationCreateDuration?: string;
62
166
  layoutAnimationCreateTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
167
+ layoutAnimationCreateDelay?: string;
63
168
  layoutAnimationCreateProperty?: 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | (string & {});
169
+ layoutAnimationDeleteDuration?: string;
64
170
  layoutAnimationDeleteTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
171
+ layoutAnimationDeleteDelay?: string;
65
172
  layoutAnimationDeleteProperty?: 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | (string & {});
173
+ layoutAnimationUpdateDuration?: string;
66
174
  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 & {});
175
+ layoutAnimationUpdateDelay?: string;
176
+
177
+ // other
178
+ top?: string;
68
179
  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 & {});
180
+ content?: string;
91
181
  overflowX?: 'hidden' | 'visible' | (string & {});
92
182
  overflowY?: 'hidden' | 'visible' | (string & {});
93
183
  wordBreak?: 'normal' | 'break-all' | 'keep-all';
94
- outlineStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
95
184
  verticalAlign?: 'baseline' | 'sub' | 'super' | 'top' | 'text-top' | 'middle' | 'bottom' | 'text-bottom' | (string & {});
96
185
  direction?: 'normal' | 'lynx-rtl' | 'rtl' | 'ltr';
186
+ relativeId?: number;
187
+ relativeAlignTop?: string;
188
+ relativeAlignRight?: string;
189
+ relativeAlignBottom?: string;
190
+ relativeAlignLeft?: string;
191
+ relativeTopOf?: number;
192
+ relativeRightOf?: number;
193
+ relativeBottomOf?: number;
194
+ relativeLeftOf?: number;
195
+ relativeLayoutOnce?: string;
97
196
  relativeCenter?: 'none' | 'vertical' | 'horizontal' | 'both';
98
- linearCrossGravity?: 'none' | 'start' | 'end' | 'center' | 'stretch';
197
+ zIndex?: number;
198
+ maskImage?: string;
199
+ justifyItems?: 'start' | 'end' | 'center' | 'stretch' | 'auto';
200
+ justifySelf?: 'start' | 'end' | 'center' | 'stretch' | 'auto';
201
+ filter?: string;
99
202
  listMainAxisGap?: 'grayscale' | (string & {});
203
+ listCrossAxisGap?: string;
204
+ perspective?: 'number' | 'vw' | 'vh' | 'default' | 'px';
205
+ cursor?: string;
206
+ clipPath?: string;
207
+ mask?: string;
208
+ left?: string;
209
+ maskRepeat?: string;
210
+ maskClip?: string;
211
+ maskOrigin?: string;
212
+ maskSize?: string;
213
+ gap?: string;
214
+ columnGap?: string;
215
+ rowGap?: string;
216
+ imageRendering?: 'auto' | 'crisp-edges' | 'pixelated';
217
+ hyphens?: 'none' | 'manual' | 'auto';
218
+ XAppRegion?: 'none' | 'drag' | 'no-drag';
219
+ XHandleSize?: string;
220
+ opacity?: number;
221
+ overflow?: 'hidden' | 'visible' | (string & {});
222
+ height?: string;
223
+ width?: string;
224
+ maxWidth?: string;
225
+ minWidth?: string;
226
+ right?: string;
227
+ maxHeight?: string;
228
+ minHeight?: string;
229
+ bottom?: string;
230
+ whiteSpace?: 'normal' | 'nowrap';
231
+ letterSpacing?: string;
232
+ alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'auto' | 'start' | 'end' | 'baseline';
233
+ alignSelf?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'auto' | 'start' | 'end' | 'baseline';
234
+ alignContent?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around' | 'start' | 'end';
235
+ justifyContent?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'start' | 'end';
236
+ boxSizing?: 'border-box' | 'content-box' | 'auto';
237
+ transform?: 'translate' | 'translateX' | 'translateY' | 'translateZ' | 'translate' | 'translate3d' | 'translate3D' | 'rotate' | 'rotateX' | 'rotateY' | 'rotateZ' | 'scale' | 'scaleX' | 'scaleY' | (string & {});
238
+ order?: number;
239
+ boxShadow?: string;
240
+ transformOrigin?: 'left' | 'right' | 'top' | 'bottom' | 'center' | (string & {});
241
+ aspectRatio?: string;
100
242
  }
101
- >;
243
+ >;