@lynx-js/types 3.2.1 → 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 +31 -0
- package/package.json +26 -10
- package/types/background-thread/animation.d.ts +10 -0
- package/types/background-thread/lynx-performance-entry.d.ts +14 -7
- package/types/background-thread/lynx.d.ts +0 -4
- package/types/background-thread/nodes-ref.d.ts +9 -0
- package/types/common/csstype.d.ts +214 -70
- package/types/common/element/element.d.ts +6 -3
- package/types/common/element/image.d.ts +104 -4
- package/types/common/element/list.d.ts +6 -0
- package/types/common/events.d.ts +57 -43
- package/types/common/props.d.ts +22 -0
- package/types/main-thread/events.d.ts +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 3.3.1
|
|
4
|
+
|
|
5
|
+
- [Infra][Types] Codegen csstype.d.ts from css_defines
|
|
6
|
+
|
|
7
|
+
## 3.3.0
|
|
8
|
+
|
|
9
|
+
### Major Changes
|
|
10
|
+
|
|
11
|
+
- Update Types Version to 3.3.*
|
|
12
|
+
- Add default properties for PipelineEntry.frameworkRenderingTiming
|
|
13
|
+
- Add some missing typing of event props
|
|
14
|
+
- Add type testing for objects & methods mounted in global
|
|
15
|
+
- Add type testing to lynx react.JSX.IntrinsicElements
|
|
16
|
+
- Add some missing types of built-in element `list`
|
|
17
|
+
- Add some missing types of built-in element `image`
|
|
18
|
+
- Add more events like `LayoutChangeEvent` into `MainThread` namespace
|
|
19
|
+
- Add animate operate function in selectorQuery
|
|
20
|
+
|
|
21
|
+
In this commit, we add `AnimationEvent`, `TransitionEvent`, `LayoutChangeEvent`, `UIAppearanceEvent` into `MainThread` namespace.
|
|
22
|
+
Now you can use like this:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
function handleLayoutChange(e: MainThread.LayoutChangeEvent) {
|
|
26
|
+
// ...
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
<view
|
|
30
|
+
main-thread:bindlayoutchange={handleLayoutChange}
|
|
31
|
+
/>
|
|
32
|
+
```
|
|
33
|
+
|
|
3
34
|
## 3.2.1
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-js/types",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "",
|
|
5
|
-
"keywords": [
|
|
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": ""
|
|
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": [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
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": [
|
|
@@ -53,6 +66,9 @@
|
|
|
53
66
|
"csstype": "3.1.3"
|
|
54
67
|
},
|
|
55
68
|
"devDependencies": {
|
|
56
|
-
"
|
|
69
|
+
"@types/react": "18.3.5",
|
|
70
|
+
"typescript": "5.8.3",
|
|
71
|
+
"tsd": "0.30.4",
|
|
72
|
+
"vitest": "2.1.9"
|
|
57
73
|
}
|
|
58
74
|
}
|
|
@@ -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,6 +7,15 @@ 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;
|
|
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
|
-
frameworkRenderingTiming:
|
|
36
|
+
frameworkRenderingTiming: FrameworkRenderingTimings[keyof FrameworkRenderingTimings] & FrameworkRenderingTiming;
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
export interface LoadBundleEntry extends PipelineEntry {
|
|
@@ -34,6 +43,10 @@ export interface LoadBundleEntry extends PipelineEntry {
|
|
|
34
43
|
parseEnd: number;
|
|
35
44
|
loadBackgroundStart: number;
|
|
36
45
|
loadBackgroundEnd: number;
|
|
46
|
+
verifyTasmStart: number;
|
|
47
|
+
verifyTasmEnd: number;
|
|
48
|
+
ffiStart: number;
|
|
49
|
+
ffiEnd: number;
|
|
37
50
|
}
|
|
38
51
|
|
|
39
52
|
export interface InitContainerEntry extends PerformanceEntry {
|
|
@@ -70,12 +83,6 @@ export interface MetricFcpEntry extends PerformanceEntry {
|
|
|
70
83
|
totalFcp: PerformanceMetric;
|
|
71
84
|
}
|
|
72
85
|
|
|
73
|
-
export interface MetricTtiEntry extends PerformanceEntry {
|
|
74
|
-
tti: PerformanceMetric;
|
|
75
|
-
lynxTti: PerformanceMetric;
|
|
76
|
-
totalTti: PerformanceMetric;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
86
|
export interface MetricActualFmpEntry extends PerformanceEntry {
|
|
80
87
|
actualFmp: PerformanceMetric;
|
|
81
88
|
lynxActualFmp: PerformanceMetric;
|
|
@@ -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;
|
|
@@ -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,98 +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
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
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;
|
|
96
|
+
linearWeight?: number;
|
|
45
97
|
linearGravity?: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'center-vertical' | 'center-horizontal' | 'space-between' | 'start' | 'end' | 'center';
|
|
46
|
-
linearLayoutGravity?:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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;
|
|
60
166
|
layoutAnimationCreateTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
167
|
+
layoutAnimationCreateDelay?: string;
|
|
61
168
|
layoutAnimationCreateProperty?: 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | (string & {});
|
|
169
|
+
layoutAnimationDeleteDuration?: string;
|
|
62
170
|
layoutAnimationDeleteTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
171
|
+
layoutAnimationDeleteDelay?: string;
|
|
63
172
|
layoutAnimationDeleteProperty?: 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | (string & {});
|
|
173
|
+
layoutAnimationUpdateDuration?: string;
|
|
64
174
|
layoutAnimationUpdateTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
65
|
-
|
|
175
|
+
layoutAnimationUpdateDelay?: string;
|
|
176
|
+
|
|
177
|
+
// other
|
|
178
|
+
top?: string;
|
|
66
179
|
visibility?: 'hidden' | 'visible' | 'none' | 'collapse';
|
|
67
|
-
|
|
68
|
-
| 'none'
|
|
69
|
-
| 'opacity'
|
|
70
|
-
| 'scaleX'
|
|
71
|
-
| 'scaleY'
|
|
72
|
-
| 'scaleXY'
|
|
73
|
-
| 'width'
|
|
74
|
-
| 'height'
|
|
75
|
-
| 'background-color'
|
|
76
|
-
| 'visibility'
|
|
77
|
-
| 'left'
|
|
78
|
-
| 'top'
|
|
79
|
-
| 'right'
|
|
80
|
-
| 'bottom'
|
|
81
|
-
| 'transform'
|
|
82
|
-
| 'all'
|
|
83
|
-
| (string & {});
|
|
84
|
-
transitionTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
85
|
-
borderLeftStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
86
|
-
borderRightStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
87
|
-
borderTopStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
88
|
-
borderBottomStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
180
|
+
content?: string;
|
|
89
181
|
overflowX?: 'hidden' | 'visible' | (string & {});
|
|
90
182
|
overflowY?: 'hidden' | 'visible' | (string & {});
|
|
91
183
|
wordBreak?: 'normal' | 'break-all' | 'keep-all';
|
|
92
|
-
outlineStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
93
184
|
verticalAlign?: 'baseline' | 'sub' | 'super' | 'top' | 'text-top' | 'middle' | 'bottom' | 'text-bottom' | (string & {});
|
|
94
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;
|
|
95
196
|
relativeCenter?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
96
|
-
|
|
197
|
+
zIndex?: number;
|
|
198
|
+
maskImage?: string;
|
|
199
|
+
justifyItems?: 'start' | 'end' | 'center' | 'stretch' | 'auto';
|
|
200
|
+
justifySelf?: 'start' | 'end' | 'center' | 'stretch' | 'auto';
|
|
201
|
+
filter?: string;
|
|
97
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;
|
|
98
242
|
}
|
|
99
|
-
>;
|
|
243
|
+
>;
|
|
@@ -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':
|
|
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':
|
|
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
|
-
*
|
|
115
|
-
* @since 2.
|
|
160
|
+
* The animation will call back when it starts playing.
|
|
161
|
+
* @since 2.11
|
|
116
162
|
*/
|
|
117
|
-
|
|
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> {}
|
package/types/common/events.d.ts
CHANGED
|
@@ -146,7 +146,7 @@ export interface BaseAnimationEvent<T> extends BaseEventOrig<{}, T> {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
export interface AnimationEvent extends BaseAnimationEvent<Target
|
|
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
|
|
173
|
+
export interface TransitionEvent extends BaseTransitionEvent<Target> {}
|
|
174
174
|
|
|
175
|
-
export interface
|
|
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
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
346
|
+
TouchStart?: EventHandler<BaseTouchEvent<T>>;
|
|
332
347
|
|
|
333
348
|
/** Moving after touching with fingers. */
|
|
334
|
-
TouchMove?: EventHandler<BaseTouchEvent<
|
|
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<
|
|
352
|
+
TouchCancel?: EventHandler<BaseTouchEvent<T>>;
|
|
338
353
|
|
|
339
354
|
/** Finger touch action ends. */
|
|
340
|
-
TouchEnd?: EventHandler<BaseTouchEvent<
|
|
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<
|
|
358
|
+
LongPress?: EventHandler<BaseCommonEvent<T>>;
|
|
344
359
|
|
|
345
360
|
/** It will trigger during a transition animation start. */
|
|
346
|
-
TransitionStart?: EventHandler<BaseTransitionEvent<
|
|
361
|
+
TransitionStart?: EventHandler<BaseTransitionEvent<T>>;
|
|
347
362
|
|
|
348
363
|
/** It will trigger when a transition animation is cancelled. */
|
|
349
|
-
TransitionCancel?: EventHandler<BaseTransitionEvent<
|
|
364
|
+
TransitionCancel?: EventHandler<BaseTransitionEvent<T>>;
|
|
350
365
|
|
|
351
366
|
/** It will trigger after the transition or createAnimation animation is finished. */
|
|
352
|
-
TransitionEnd?: EventHandler<BaseTransitionEvent<
|
|
367
|
+
TransitionEnd?: EventHandler<BaseTransitionEvent<T>>;
|
|
353
368
|
|
|
354
369
|
/** It will trigger at the beginning of an animation. */
|
|
355
|
-
AnimationStart?: EventHandler<BaseAnimationEvent<
|
|
370
|
+
AnimationStart?: EventHandler<BaseAnimationEvent<T>>;
|
|
356
371
|
|
|
357
372
|
/** It will trigger during an animation iteration. */
|
|
358
|
-
AnimationIteration?: EventHandler<BaseAnimationEvent<
|
|
373
|
+
AnimationIteration?: EventHandler<BaseAnimationEvent<T>>;
|
|
359
374
|
|
|
360
375
|
/** It will trigger when an animation is cancelled. */
|
|
361
|
-
AnimationCancel?: EventHandler<BaseAnimationEvent<
|
|
376
|
+
AnimationCancel?: EventHandler<BaseAnimationEvent<T>>;
|
|
362
377
|
|
|
363
378
|
/** It will trigger upon completion of an animation. */
|
|
364
|
-
AnimationEnd?: EventHandler<BaseAnimationEvent<
|
|
379
|
+
AnimationEnd?: EventHandler<BaseAnimationEvent<T>>;
|
|
365
380
|
|
|
366
381
|
/** Mouse Clicked. */
|
|
367
|
-
MouseDown?: EventHandler<BaseMouseEvent<
|
|
382
|
+
MouseDown?: EventHandler<BaseMouseEvent<T>>;
|
|
368
383
|
|
|
369
384
|
/** Mouse released. */
|
|
370
|
-
MouseUp?: EventHandler<BaseMouseEvent<
|
|
385
|
+
MouseUp?: EventHandler<BaseMouseEvent<T>>;
|
|
371
386
|
|
|
372
387
|
/** Mouse movement. */
|
|
373
|
-
MouseMove?: EventHandler<BaseMouseEvent<
|
|
388
|
+
MouseMove?: EventHandler<BaseMouseEvent<T>>;
|
|
374
389
|
|
|
375
390
|
/** Mouse click. */
|
|
376
|
-
MouseClick?: EventHandler<BaseMouseEvent<
|
|
391
|
+
MouseClick?: EventHandler<BaseMouseEvent<T>>;
|
|
377
392
|
|
|
378
393
|
/** Double-click the mouse. */
|
|
379
|
-
MouseDblClick?: EventHandler<BaseMouseEvent<
|
|
394
|
+
MouseDblClick?: EventHandler<BaseMouseEvent<T>>;
|
|
380
395
|
|
|
381
396
|
/** Long press on the mouse. */
|
|
382
|
-
MouseLongPress?: EventHandler<BaseMouseEvent<
|
|
397
|
+
MouseLongPress?: EventHandler<BaseMouseEvent<T>>;
|
|
383
398
|
|
|
384
399
|
/** Mouse (or touchpad) scrolling. */
|
|
385
|
-
Wheel?: EventHandler<BaseWheelEvent<
|
|
400
|
+
Wheel?: EventHandler<BaseWheelEvent<T>>;
|
|
386
401
|
|
|
387
402
|
/** Keyboard (or remote control) button pressed. */
|
|
388
|
-
KeyDown?: EventHandler<BaseKeyEvent<
|
|
403
|
+
KeyDown?: EventHandler<BaseKeyEvent<T>>;
|
|
389
404
|
|
|
390
405
|
/** Keyboard (or remote control) key released. */
|
|
391
|
-
KeyUp?: EventHandler<BaseKeyEvent<
|
|
406
|
+
KeyUp?: EventHandler<BaseKeyEvent<T>>;
|
|
392
407
|
|
|
393
408
|
/** Element gets focus. */
|
|
394
|
-
Focus?: EventHandler<BaseCommonEvent<
|
|
409
|
+
Focus?: EventHandler<BaseCommonEvent<T>>;
|
|
395
410
|
|
|
396
411
|
/** Element loses focus. */
|
|
397
|
-
Blur?: EventHandler<BaseCommonEvent<
|
|
412
|
+
Blur?: EventHandler<BaseCommonEvent<T>>;
|
|
398
413
|
|
|
399
414
|
/** layout info Change event */
|
|
400
|
-
LayoutChange?:
|
|
415
|
+
LayoutChange?: EventHandler<LayoutChangeDetailEvent<T>>;
|
|
401
416
|
|
|
402
417
|
/** UI appear event */
|
|
403
|
-
UIAppear?:
|
|
418
|
+
UIAppear?: EventHandler<UIAppearanceDetailEvent<T>>;
|
|
404
419
|
|
|
405
420
|
/** UI disappear event */
|
|
406
|
-
UIDisappear?:
|
|
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<
|
|
434
|
+
AccessibilityAction?: EventHandler<AccessibilityActionDetailEvent<T>>;
|
|
420
435
|
}
|
|
421
436
|
|
|
422
|
-
export
|
|
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<
|
|
443
|
+
export interface LynxBindCatchEvent<T = any> {
|
|
430
444
|
/** Immediately lift your finger after touching. */
|
|
431
|
-
Tap?: EventHandler<BaseTouchEvent<
|
|
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<
|
|
448
|
+
LongTap?: EventHandler<BaseTouchEvent<T>>;
|
|
435
449
|
}
|
|
436
450
|
|
|
437
|
-
export type LynxEventPropsBase<
|
|
438
|
-
[K in keyof LynxEvent<
|
|
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<
|
|
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>;
|
package/types/common/props.d.ts
CHANGED
|
@@ -121,6 +121,28 @@ export interface StandardProps extends LynxEventProps {
|
|
|
121
121
|
* @since Lynx 3.1
|
|
122
122
|
*/
|
|
123
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;
|
|
124
146
|
}
|
|
125
147
|
|
|
126
148
|
export interface NoProps {
|
|
@@ -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
|
|
25
|
+
declare module '../common/props' {
|
|
19
26
|
interface StandardProps extends LynxWorkletEventProps {}
|
|
20
|
-
}
|
|
27
|
+
}
|