@lynx-js/types 0.0.1 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +56 -0
  3. package/package.json +53 -6
  4. package/types/background-thread/animation.d.ts +47 -0
  5. package/types/background-thread/app.d.ts +28 -0
  6. package/types/background-thread/event.d.ts +97 -0
  7. package/types/background-thread/fetch.d.ts +152 -0
  8. package/types/background-thread/index.d.ts +11 -0
  9. package/types/background-thread/lynx-performance-entry.d.ts +83 -0
  10. package/types/background-thread/lynx.d.ts +144 -0
  11. package/types/background-thread/native-modules.d.ts +21 -0
  12. package/types/background-thread/nodes-ref.d.ts +110 -0
  13. package/types/background-thread/performance.d.ts +100 -0
  14. package/types/common/console.d.ts +14 -0
  15. package/types/common/csstype.d.ts +99 -0
  16. package/types/common/element/attributes.d.ts +59 -0
  17. package/types/common/element/common.d.ts +41 -0
  18. package/types/common/element/component.d.ts +17 -0
  19. package/types/common/element/element.d.ts +59 -0
  20. package/types/common/element/filter-image.d.ts +67 -0
  21. package/types/common/element/image.d.ts +121 -0
  22. package/types/common/element/index.d.ts +16 -0
  23. package/types/common/element/list.d.ts +1161 -0
  24. package/types/common/element/methods.d.ts +84 -0
  25. package/types/common/element/page.d.ts +10 -0
  26. package/types/common/element/scroll-view.d.ts +280 -0
  27. package/types/common/element/text.d.ts +97 -0
  28. package/types/common/element/view.d.ts +7 -0
  29. package/types/common/events.d.ts +448 -0
  30. package/types/common/global.d.ts +47 -0
  31. package/types/common/index.d.ts +13 -0
  32. package/types/common/lynx.d.ts +35 -0
  33. package/types/common/performance.d.ts +78 -0
  34. package/types/common/props.d.ts +119 -0
  35. package/types/common/system-info.d.ts +46 -0
  36. package/types/index.d.ts +8 -0
  37. package/types/main-thread/element.d.ts +85 -0
  38. package/types/main-thread/events.d.ts +20 -0
  39. package/types/main-thread/index.d.ts +7 -0
  40. package/types/main-thread/lynx.d.ts +28 -0
@@ -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';