@lynx-js/types 0.0.1 → 3.2.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 +67 -0
- package/LICENSE +203 -0
- package/README.md +56 -0
- package/package.json +53 -6
- package/types/background-thread/animation.d.ts +47 -0
- package/types/background-thread/app.d.ts +28 -0
- package/types/background-thread/event.d.ts +97 -0
- package/types/background-thread/fetch.d.ts +152 -0
- package/types/background-thread/index.d.ts +11 -0
- package/types/background-thread/lynx-performance-entry.d.ts +83 -0
- package/types/background-thread/lynx.d.ts +157 -0
- package/types/background-thread/native-modules.d.ts +21 -0
- package/types/background-thread/nodes-ref.d.ts +110 -0
- package/types/background-thread/performance.d.ts +100 -0
- package/types/background-thread/text-encoder-decoder.d.ts +22 -0
- package/types/common/console.d.ts +14 -0
- package/types/common/csstype.d.ts +99 -0
- package/types/common/element/attributes.d.ts +59 -0
- package/types/common/element/common.d.ts +41 -0
- package/types/common/element/component.d.ts +17 -0
- package/types/common/element/element.d.ts +59 -0
- package/types/common/element/filter-image.d.ts +67 -0
- package/types/common/element/image.d.ts +121 -0
- package/types/common/element/index.d.ts +16 -0
- package/types/common/element/list.d.ts +1189 -0
- package/types/common/element/methods.d.ts +84 -0
- package/types/common/element/page.d.ts +10 -0
- package/types/common/element/scroll-view.d.ts +280 -0
- package/types/common/element/text.d.ts +97 -0
- package/types/common/element/view.d.ts +7 -0
- package/types/common/events.d.ts +448 -0
- package/types/common/global.d.ts +47 -0
- package/types/common/index.d.ts +13 -0
- package/types/common/lynx.d.ts +35 -0
- package/types/common/performance.d.ts +78 -0
- package/types/common/props.d.ts +128 -0
- package/types/common/system-info.d.ts +55 -0
- package/types/index.d.ts +8 -0
- package/types/main-thread/element.d.ts +85 -0
- package/types/main-thread/events.d.ts +20 -0
- package/types/main-thread/index.d.ts +7 -0
- package/types/main-thread/lynx.d.ts +28 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
import * as CSS from 'csstype';
|
|
6
|
+
|
|
7
|
+
export type Modify<T, R> = Omit<T, keyof R> & R;
|
|
8
|
+
|
|
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
|
+
linearOrientation?: 'horizontal' | 'vertical' | 'horizontal-reverse' | 'vertical-reverse';
|
|
45
|
+
linearGravity?: 'none' | 'top' | 'bottom' | 'left' | 'right' | 'center-vertical' | 'center-horizontal' | 'space-between' | 'start' | 'end' | 'center';
|
|
46
|
+
linearLayoutGravity?:
|
|
47
|
+
| 'none'
|
|
48
|
+
| 'top'
|
|
49
|
+
| 'bottom'
|
|
50
|
+
| 'left'
|
|
51
|
+
| 'right'
|
|
52
|
+
| 'center-vertical'
|
|
53
|
+
| 'center-horizontal'
|
|
54
|
+
| 'fill-vertical'
|
|
55
|
+
| 'fill-horizontal'
|
|
56
|
+
| 'center'
|
|
57
|
+
| 'stretch'
|
|
58
|
+
| 'start'
|
|
59
|
+
| 'end';
|
|
60
|
+
layoutAnimationCreateTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
61
|
+
layoutAnimationCreateProperty?: 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | (string & {});
|
|
62
|
+
layoutAnimationDeleteTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
63
|
+
layoutAnimationDeleteProperty?: 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY' | (string & {});
|
|
64
|
+
layoutAnimationUpdateTimingFunction?: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-ease-out' | 'ease' | 'ease-in-out' | 'square-bezier' | 'cubic-bezier' | (string & {});
|
|
65
|
+
textDecoration?: 'none' | 'underline' | 'line-through' | (string & {});
|
|
66
|
+
visibility?: 'hidden' | 'visible' | 'none' | 'collapse';
|
|
67
|
+
transitionProperty?:
|
|
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 & {});
|
|
89
|
+
overflowX?: 'hidden' | 'visible' | (string & {});
|
|
90
|
+
overflowY?: 'hidden' | 'visible' | (string & {});
|
|
91
|
+
wordBreak?: 'normal' | 'break-all' | 'keep-all';
|
|
92
|
+
outlineStyle?: 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'inset' | 'outset' | 'hidden' | 'none' | (string & {});
|
|
93
|
+
verticalAlign?: 'baseline' | 'sub' | 'super' | 'top' | 'text-top' | 'middle' | 'bottom' | 'text-bottom' | (string & {});
|
|
94
|
+
direction?: 'normal' | 'lynx-rtl' | 'rtl' | 'ltr';
|
|
95
|
+
relativeCenter?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
96
|
+
linearCrossGravity?: 'none' | 'start' | 'end' | 'center' | 'stretch';
|
|
97
|
+
listMainAxisGap?: 'grayscale' | (string & {});
|
|
98
|
+
}
|
|
99
|
+
>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
import { CSSProperties } from '../csstype';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* IntrinsicAttributes specifies extra properties used by the JSX framework
|
|
9
|
+
* which are not generally used by the components’ props or arguments.
|
|
10
|
+
* @see https://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking
|
|
11
|
+
*
|
|
12
|
+
* But in Lynx, we use this interface to specify the extra attributes
|
|
13
|
+
* just for Lynx components.
|
|
14
|
+
* @see Lynx/tasm/component_attributes.cc
|
|
15
|
+
*/
|
|
16
|
+
export interface IntrinsicAttributes {
|
|
17
|
+
/**
|
|
18
|
+
* A type helper for Lynx, DO NOT SET THIS.
|
|
19
|
+
*/
|
|
20
|
+
__empty?: false;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The name of the component
|
|
24
|
+
*/
|
|
25
|
+
name?: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The style set to the view of component.
|
|
29
|
+
*
|
|
30
|
+
* Has no effect when `removeComponentElement` enabled.
|
|
31
|
+
*/
|
|
32
|
+
style?: string | CSSProperties;
|
|
33
|
+
|
|
34
|
+
// /**
|
|
35
|
+
// * The CSS classes set to the view of component.
|
|
36
|
+
// *
|
|
37
|
+
// * Has no effect when `removeComponentElement` enabled.
|
|
38
|
+
// */
|
|
39
|
+
// className?: string;
|
|
40
|
+
class?: string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Set to `true` to enable overlapping rendering
|
|
44
|
+
*/
|
|
45
|
+
overlap?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type LynxIntrinsicAttributes = IntrinsicAttributes;
|
|
49
|
+
|
|
50
|
+
declare global {
|
|
51
|
+
namespace JSX {
|
|
52
|
+
interface IntrinsicAttributes extends LynxIntrinsicAttributes {
|
|
53
|
+
/**
|
|
54
|
+
* A type helper for Lynx, DO NOT SET THIS.
|
|
55
|
+
*/
|
|
56
|
+
__empty?: never;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
import { BaseEvent } from '../events';
|
|
6
|
+
export interface BaseScrollInfo {
|
|
7
|
+
/**
|
|
8
|
+
* scroll top from start
|
|
9
|
+
*/
|
|
10
|
+
scrollTop: number;
|
|
11
|
+
/**
|
|
12
|
+
* scroll left from start
|
|
13
|
+
*/
|
|
14
|
+
scrollLeft: number;
|
|
15
|
+
/**
|
|
16
|
+
* scroll content height
|
|
17
|
+
*/
|
|
18
|
+
scrollHeight: number;
|
|
19
|
+
/**
|
|
20
|
+
* scroll content width
|
|
21
|
+
*/
|
|
22
|
+
scrollWidth: number;
|
|
23
|
+
/**
|
|
24
|
+
* X-axis scroll delta for this scroll. It's always 0 in some non-scroll related events.
|
|
25
|
+
*/
|
|
26
|
+
deltaX: number;
|
|
27
|
+
/**
|
|
28
|
+
* Y-axis scroll delta for this scroll. It's always 0 in some non-scroll related events.
|
|
29
|
+
*/
|
|
30
|
+
deltaY: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ScrollToLowerEvent extends BaseEvent<'scrolltolower', BaseScrollInfo> {}
|
|
34
|
+
export interface ScrollToUpperEvent extends BaseEvent<'scrolltoupper', BaseScrollInfo> {}
|
|
35
|
+
export interface ScrollEvent extends BaseEvent<'scroll', BaseScrollInfo> {}
|
|
36
|
+
export interface ScrollEndEvent extends BaseEvent<'scrollend', BaseScrollInfo> {}
|
|
37
|
+
export interface ContentSizeChangedEvent extends BaseEvent<'contentsizechanged', BaseScrollInfo> {}
|
|
38
|
+
export interface ScrollToUpperEdgeEvent extends BaseEvent<'scrolltoupperedge', BaseScrollInfo> {}
|
|
39
|
+
export interface ScrollToLowerEdgeEvent extends BaseEvent<'scrolltoloweredge', BaseScrollInfo> {}
|
|
40
|
+
export interface ScrollToNormalStateEvent extends BaseEvent<'scrolltonormalstate', BaseScrollInfo> {}
|
|
41
|
+
export interface ScrollToNormalStateEvent extends BaseEvent<'scrolltonormalstate', BaseScrollInfo> {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
import { StandardProps } from '../props';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Dynamic Component
|
|
9
|
+
*/
|
|
10
|
+
export interface ComponentProps extends StandardProps {
|
|
11
|
+
/**
|
|
12
|
+
* Component name
|
|
13
|
+
*/
|
|
14
|
+
'is'?: string;
|
|
15
|
+
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
import { StandardProps } from '../props';
|
|
6
|
+
import { NoProps } from '../props';
|
|
7
|
+
import { ComponentProps } from './component';
|
|
8
|
+
import { FilterImageProps } from './filter-image';
|
|
9
|
+
import { ImageProps } from './image';
|
|
10
|
+
import { ListItemProps, ListProps, ListRowProps, ListUIMethods } from './list';
|
|
11
|
+
import { PageProps } from './page';
|
|
12
|
+
import { ScrollViewProps, ScrollViewUIMethods } from './scroll-view';
|
|
13
|
+
import { TextProps } from './text';
|
|
14
|
+
import { ViewProps } from './view';
|
|
15
|
+
|
|
16
|
+
export interface UIMethods {
|
|
17
|
+
'list': ListUIMethods;
|
|
18
|
+
'scroll-view': ScrollViewUIMethods;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// add also to global.JSX.IntrinsicElements
|
|
22
|
+
export interface IntrinsicElements {
|
|
23
|
+
'component': ComponentProps;
|
|
24
|
+
'filter-image': FilterImageProps;
|
|
25
|
+
'image': ImageProps;
|
|
26
|
+
'inline-image': ImageProps;
|
|
27
|
+
'inline-text': TextProps;
|
|
28
|
+
'inline-truncation': NoProps;
|
|
29
|
+
'list': ListProps;
|
|
30
|
+
'list-item': ListItemProps;
|
|
31
|
+
'list-row': ListRowProps;
|
|
32
|
+
'page': PageProps;
|
|
33
|
+
'scroll-view': ScrollViewProps;
|
|
34
|
+
'text': TextProps;
|
|
35
|
+
'view': ViewProps;
|
|
36
|
+
'raw-text': StandardProps & { text: number | string };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module 'react' {
|
|
40
|
+
namespace JSX {
|
|
41
|
+
// Should copy from above IntrinsicElements
|
|
42
|
+
interface IntrinsicElements {
|
|
43
|
+
'component': ComponentProps;
|
|
44
|
+
'filter-image': FilterImageProps;
|
|
45
|
+
'image': ImageProps;
|
|
46
|
+
'inline-image': ImageProps;
|
|
47
|
+
'inline-text': TextProps;
|
|
48
|
+
'inline-truncation': NoProps;
|
|
49
|
+
'list': ListProps;
|
|
50
|
+
'list-item': ListItemProps;
|
|
51
|
+
'list-row': ListRowProps;
|
|
52
|
+
'page': PageProps;
|
|
53
|
+
'scroll-view': ScrollViewProps;
|
|
54
|
+
'text': TextProps;
|
|
55
|
+
'view': ViewProps;
|
|
56
|
+
'raw-text': StandardProps & { text: number | string };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
import { StandardProps } from '../props';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Provides image blur and shadow features, similar to the usage of images. Specially, shadow and blur effects can be displayed inside the padding area.
|
|
9
|
+
*/
|
|
10
|
+
export interface FilterImageLoadEvent {
|
|
11
|
+
detail: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface FilterImageErrorEvent {
|
|
18
|
+
detail: {
|
|
19
|
+
errMsg: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface FilterImageProps extends StandardProps {
|
|
24
|
+
/**
|
|
25
|
+
* Supports http/https/base64
|
|
26
|
+
* @defaultValue ""
|
|
27
|
+
* @since 0.2
|
|
28
|
+
*/
|
|
29
|
+
'src'?: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Specifies image cropping/scaling mode
|
|
33
|
+
* scaleToFill: Scales the image without preserving the aspect ratio, stretching the image to fill the element
|
|
34
|
+
* aspectFit: Scales the image while preserving aspect ratio so that the long side is fully visible
|
|
35
|
+
* aspectFill: Scales the image while preserving aspect ratio, ensuring the short side fills the element
|
|
36
|
+
* center: Does not scale the image; image is centered
|
|
37
|
+
* @defaultValue "scaleToFill"
|
|
38
|
+
* @since 0.2
|
|
39
|
+
*/
|
|
40
|
+
'mode'?: 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'center';
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Specifies the BoxBlur radius for the image
|
|
44
|
+
* @defaultValue "0px"
|
|
45
|
+
* @since 0.2
|
|
46
|
+
*/
|
|
47
|
+
'blur-radius'?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Specifies the shadow style for the image
|
|
51
|
+
* @defaultValue ""
|
|
52
|
+
* @since 0.2
|
|
53
|
+
*/
|
|
54
|
+
'drop-shadow'?: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Image load success event
|
|
58
|
+
* @since 0.2
|
|
59
|
+
*/
|
|
60
|
+
'bindload'?: (e: FilterImageLoadEvent) => void;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Image load error event
|
|
64
|
+
* @since 0.2
|
|
65
|
+
*/
|
|
66
|
+
'binderror'?: (e: FilterImageErrorEvent) => void;
|
|
67
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
import { BaseEvent, ImageErrorEvent, ImageLoadEvent } from '../events';
|
|
6
|
+
import { StandardProps } from '../props';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Used to display images
|
|
10
|
+
*/
|
|
11
|
+
export interface ImageProps extends StandardProps {
|
|
12
|
+
/**
|
|
13
|
+
* Supports http/https/base64
|
|
14
|
+
* @defaultValue ""
|
|
15
|
+
* @since 0.2
|
|
16
|
+
*/
|
|
17
|
+
src?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Specifies image cropping/scaling mode
|
|
21
|
+
* scaleToFill: Scales the image without preserving the aspect ratio, stretching the image to fill the element
|
|
22
|
+
* aspectFit: Scales the image while preserving aspect ratio so that the long side is fully visible
|
|
23
|
+
* aspectFill: Scales the image while preserving aspect ratio, ensuring the short side fills the element
|
|
24
|
+
* center: Does not scale the image; image is centered
|
|
25
|
+
* @defaultValue "scaleToFill"
|
|
26
|
+
* @since 0.2
|
|
27
|
+
*/
|
|
28
|
+
mode?: 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'center';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* ARGB_8888: 32-bit memory per pixel, supports semi-transparent images
|
|
32
|
+
* RGB_565: 16-bit memory per pixel, reduces memory usage but loses transparency
|
|
33
|
+
* @defaultValue "ARGB_8888"
|
|
34
|
+
* @since 1.4
|
|
35
|
+
*/
|
|
36
|
+
'image-config'?: 'ARGB_8888' | 'RGB_565';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Placeholder image, used same as src
|
|
40
|
+
* @defaultValue ""
|
|
41
|
+
* @since 1.4
|
|
42
|
+
*/
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Image blur radius
|
|
47
|
+
* @defaultValue "3px"
|
|
48
|
+
* @since 0.2
|
|
49
|
+
*/
|
|
50
|
+
'blur-radius'?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Stretchable area for 9patch images, in percentage or decimal, four values for top, right, bottom, left
|
|
54
|
+
* @defaultValue "0.2 10% 0.3 20%"
|
|
55
|
+
* @since 1.4
|
|
56
|
+
*/
|
|
57
|
+
'cap-insets'?: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Number of times an animated image plays
|
|
61
|
+
* @defaultValue 1
|
|
62
|
+
* @since 1.4
|
|
63
|
+
*/
|
|
64
|
+
'loop-count'?: number;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Image won't load if its size is 0, but will load if prefetch-width is set
|
|
68
|
+
* @defaultValue "100px"
|
|
69
|
+
* @since 1.4
|
|
70
|
+
*/
|
|
71
|
+
'prefetch-width'?: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Image won't load if its size is 0, but will load if prefetch-height is set
|
|
75
|
+
* @defaultValue "100px"
|
|
76
|
+
* @since 1.4
|
|
77
|
+
*/
|
|
78
|
+
'prefetch-height'?: string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* If true, URL mapping is skipped. LynxView's custom ImageInterceptor won't work
|
|
82
|
+
* @defaultValue false
|
|
83
|
+
* @since 1.5
|
|
84
|
+
*/
|
|
85
|
+
'skip-redirection'?: boolean;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Reduces the chance of OOM by downsampling large images, requires container support
|
|
89
|
+
* @defaultValue false
|
|
90
|
+
* @since iOS 2.0
|
|
91
|
+
*/
|
|
92
|
+
downsampling?: boolean;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Disables unexpected iOS built-in animations
|
|
96
|
+
* @defaultValue true
|
|
97
|
+
* @since iOS 2.0
|
|
98
|
+
*/
|
|
99
|
+
'implicit-animation'?: boolean;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Image load success event
|
|
103
|
+
* @since 0.2
|
|
104
|
+
*/
|
|
105
|
+
bindload?: (e: LoadEvent) => void;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Image load error event
|
|
109
|
+
* @since 0.2
|
|
110
|
+
*/
|
|
111
|
+
binderror?: (e: ErrorEvent) => void;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Add custom parameters to image
|
|
115
|
+
* @since 2.17
|
|
116
|
+
*/
|
|
117
|
+
'additional-custom-info'?: { [key: string]: string };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type LoadEvent = BaseEvent<'load', ImageLoadEvent>;
|
|
121
|
+
export type ErrorEvent = BaseEvent<'error', ImageErrorEvent>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
export * from './component';
|
|
6
|
+
export * from './filter-image';
|
|
7
|
+
export * from './image';
|
|
8
|
+
export * from './list';
|
|
9
|
+
export * from './page';
|
|
10
|
+
export * from './scroll-view';
|
|
11
|
+
export * from './text';
|
|
12
|
+
export * from './view';
|
|
13
|
+
export * from './element';
|
|
14
|
+
export * from './methods';
|
|
15
|
+
export * from './attributes';
|
|
16
|
+
export * from './common';
|