@dcloudio/uni-app-x 0.7.62 → 0.7.64

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 (81) hide show
  1. package/package.json +1 -1
  2. package/types/app.d.ts +36 -1
  3. package/types/dom2/UniCSSProperty.d.ts +446 -0
  4. package/types/dom2/UniCSSType.d.ts +72 -0
  5. package/types/dom2/UniCommon.d.ts +40 -0
  6. package/types/dom2/UniCustomViewElement.d.ts +12 -0
  7. package/types/dom2/UniElement.d.ts +354 -0
  8. package/types/dom2/UniElementType.d.ts +37 -0
  9. package/types/dom2/UniImageElement.d.ts +102 -0
  10. package/types/dom2/UniNativeBaseView.d.ts +178 -0
  11. package/types/dom2/UniNativeCustomView.d.ts +13 -0
  12. package/types/dom2/UniNativeDefines.d.ts +435 -0
  13. package/types/dom2/UniNativeImageView.d.ts +34 -0
  14. package/types/dom2/UniNativeScrollView.d.ts +42 -0
  15. package/types/dom2/UniNativeTextView.d.ts +25 -0
  16. package/types/dom2/UniNativeView.d.ts +51 -0
  17. package/types/dom2/UniNativeViewType.d.ts +22 -0
  18. package/types/dom2/UniPage.d.ts +55 -0
  19. package/types/dom2/UniScrollViewElement.d.ts +13 -0
  20. package/types/dom2/UniTextElement.d.ts +20 -0
  21. package/types/dom2/UniTextLayout.d.ts +386 -0
  22. package/types/dom2/UniViewElement.d.ts +57 -0
  23. package/types/dom2/global.d.ts +189 -0
  24. package/types/dom2/index.d.ts +40 -0
  25. package/types/dom2/sharedData.d.ts +227 -0
  26. package/types/index.d.ts +2 -1
  27. package/types/native/DOMRect.d.ts +2 -1
  28. package/types/native/DrawableContext.d.ts +1665 -1661
  29. package/types/native/IUniElement.d.ts +3514 -2877
  30. package/types/native/SnapshotOptions.d.ts +2 -2
  31. package/types/native/UniAnimation.d.ts +11 -10
  32. package/types/native/UniElement.d.ts +1 -1
  33. package/types/native/UniEvent.d.ts +108 -3
  34. package/types/native/UniPage.d.ts +891 -887
  35. package/types/native/UniTextElement.d.ts +37 -0
  36. package/types/native/UniTextLayout.d.ts +387 -0
  37. package/types/native/UniVideoElement.d.ts +20 -17
  38. package/types/native/Worker.d.ts +19 -0
  39. package/types/native/global.d.ts +28 -68
  40. package/types/native/index.d.ts +18 -1
  41. package/types/page.d.ts +1862 -599
  42. package/types/uni/uts-plugin-api/global.d.ts +2 -0
  43. package/types/uni/uts-plugin-api/index.d.ts +2 -0
  44. package/types/uni/uts-plugin-api/lib/uni-chooseMedia/utssdk/interface.d.ts +1 -1
  45. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +10 -10
  46. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +0 -1
  47. package/types/uni/uts-plugin-api/lib/uni-createWorker/utssdk/global.d.ts +22 -0
  48. package/types/uni/uts-plugin-api/lib/uni-createWorker/utssdk/index.d.ts +10 -0
  49. package/types/uni/uts-plugin-api/lib/uni-createWorker/utssdk/interface.d.ts +524 -0
  50. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +985 -76
  51. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +79 -55
  52. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +77 -53
  53. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +458 -407
  54. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +420 -0
  55. package/types/uni/uts-plugin-api/lib/uni-location/utssdk/interface.d.ts +80 -80
  56. package/types/uni/uts-plugin-api/lib/uni-modal/utssdk/global.d.ts +12 -4
  57. package/types/uni/uts-plugin-api/lib/uni-modal/utssdk/index.d.ts +6 -2
  58. package/types/uni/uts-plugin-api/lib/uni-modal/utssdk/interface.d.ts +713 -91
  59. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +4 -0
  60. package/types/uni/uts-plugin-api/lib/uni-oauth/utssdk/interface.d.ts +3 -3
  61. package/types/uni/uts-plugin-api/lib/uni-oauth-weixin/utssdk/interface.d.ts +3 -1
  62. package/types/uni/uts-plugin-api/lib/uni-recorder/utssdk/interface.d.ts +71 -1
  63. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +1 -1
  64. package/types/uni/uts-plugin-api/lib/uni-screenBrightness/utssdk/global.d.ts +56 -0
  65. package/types/uni/uts-plugin-api/lib/uni-screenBrightness/utssdk/index.d.ts +27 -0
  66. package/types/uni/uts-plugin-api/lib/uni-screenBrightness/utssdk/interface.d.ts +842 -0
  67. package/types/uni/uts-plugin-api/lib/uni-share/utssdk/interface.d.ts +11 -11
  68. package/types/uni/uts-plugin-api/lib/uni-share-weixin/utssdk/interface.d.ts +1 -1
  69. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +63 -42
  70. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +2 -2
  71. package/types/uni/uts-plugin-biz/lib/uni-facialVerify/utssdk/interface.d.ts +2 -2
  72. package/types/uni/uts-plugin-biz/lib/uni-live-player/utssdk/global.d.ts +4 -0
  73. package/types/uni/uts-plugin-biz/lib/uni-live-player/utssdk/index.d.ts +2 -0
  74. package/types/uni/uts-plugin-biz/lib/uni-live-player/utssdk/interface.d.ts +1007 -314
  75. package/types/uni/uts-plugin-biz/lib/uni-live-pusher/utssdk/global.d.ts +4 -0
  76. package/types/uni/uts-plugin-biz/lib/uni-live-pusher/utssdk/index.d.ts +2 -0
  77. package/types/uni/uts-plugin-biz/lib/uni-live-pusher/utssdk/interface.d.ts +1727 -10
  78. package/types/uni/uts-plugin-component/lib/uni-camera/utssdk/interface.d.ts +235 -30
  79. package/types/uni/uts-plugin-component/lib/uni-canvas/utssdk/interface.d.ts +1 -1
  80. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +17 -17
  81. package/uts-plugin.d.ts +11 -0
@@ -0,0 +1,435 @@
1
+ /**
2
+ * NativeView通用基础类型定义
3
+ *
4
+ * 特别说明
5
+ * 类型中涉及长度单位的,如果没有特殊说明,单位为逻辑像素值,渲染时需转换各自平台需要的值
6
+ */
7
+ import { UniSize, UniPosition, UniLTWH, UniLTRB } from './UniCommon'
8
+
9
+
10
+ /**
11
+ * 颜色对象
12
+ * 不同平台根据自身使用自己的类型,比如Int
13
+ */
14
+ export type UniNativeColor = {
15
+ /**
16
+ * 颜色值
17
+ * 如何定义各平台根据实际情况处理,可以使用CSSOM中的颜色定义(新取别名)
18
+ */
19
+ }
20
+
21
+
22
+ /**
23
+ * 位置对象
24
+ */
25
+ export type UniNativeLayout = UniLTWH
26
+ /**
27
+ * 尺寸信息
28
+ */
29
+ export type UniNativeLayoutSize = UniSize
30
+
31
+ /**
32
+ * 位置信息
33
+ */
34
+ export type UniNativeLayoutPosition = UniPosition
35
+
36
+ /**
37
+ * 内边距
38
+ */
39
+ export type UniNativePadding = number
40
+ /**
41
+ * 内边距信息
42
+ */
43
+ export type UniNativePaddings = UniLTRB
44
+
45
+ /**
46
+ * 外边距
47
+ */
48
+ export type UniNativeMargin = number
49
+ /**
50
+ * 外边距详细信息
51
+ */
52
+ export type UniNativeMargins = UniLTRB
53
+
54
+ /**
55
+ * 边框信息
56
+ */
57
+ export type UniNativeBorders = {
58
+ /**
59
+ * 边框宽度
60
+ */
61
+ width: UniNativeBorderWidths
62
+ /**
63
+ * 边框颜色
64
+ */
65
+ color: UniNativeBorderColors
66
+ /**
67
+ * 边框圆角半径
68
+ */
69
+ radius: UniNativeBorderRadiuses
70
+ /**
71
+ * 比那款样式
72
+ */
73
+ style: UniNativeBorderStyles
74
+ }
75
+ export type UniNativeBorder = {
76
+ /**
77
+ * 边框宽度
78
+ */
79
+ width: UniNativeBorderWidth
80
+ /**
81
+ * 边框颜色
82
+ */
83
+ color: UniNativeBorderColor
84
+ /**
85
+ * 边框圆角半径
86
+ */
87
+ radius: UniNativeBorderRadius
88
+ /**
89
+ * 比那款样式
90
+ */
91
+ style: UniNativeBorderStyle
92
+ }
93
+
94
+ /**
95
+ * 边框宽度类型
96
+ */
97
+ export type UniNativeBorderWidth = number
98
+ /**
99
+ * 边框宽度详细信息
100
+ */
101
+ export type UniNativeBorderWidths = UniLTRB
102
+ /**
103
+ * 边框颜色
104
+ */
105
+ export type UniNativeBorderColor = UniNativeColor
106
+ /**
107
+ * 边框颜色详细信息
108
+ */
109
+ export type UniNativeBorderColors = {
110
+ /**
111
+ * 上边框颜色
112
+ */
113
+ top: UniNativeBorderColor
114
+ /**
115
+ * 右边框颜色
116
+ */
117
+ right: UniNativeBorderColor
118
+ /**
119
+ * 下边框颜色
120
+ */
121
+ bottom: UniNativeBorderColor
122
+ /**
123
+ * 左边框颜色
124
+ */
125
+ left: UniNativeBorderColor
126
+ }
127
+
128
+ /**
129
+ * 边框样式
130
+ */
131
+ export enum UniNativeBorderStyle {
132
+ /**
133
+ * 无边框
134
+ */
135
+ None,
136
+ /**
137
+ * 实线样式边框
138
+ */
139
+ Solid,
140
+ /**
141
+ * 方形虚线样式边框
142
+ */
143
+ Dashed,
144
+ /**
145
+ * 圆点样式边框,圆点半径为borderWidth的一半
146
+ */
147
+ Dotted
148
+ }
149
+ /**
150
+ * 边框样式详细信息
151
+ */
152
+ export type UniNativeBorderStyles = {
153
+ /**
154
+ * 上边框样式
155
+ */
156
+ top: UniNativeBorderStyle
157
+ /**
158
+ * 右边框样式
159
+ */
160
+ right: UniNativeBorderStyle
161
+ /**
162
+ * 下边框样式
163
+ */
164
+ bottom: UniNativeBorderStyle
165
+ /**
166
+ * 左边框样式
167
+ */
168
+ left: UniNativeBorderStyle
169
+ }
170
+
171
+ /**
172
+ * 边框圆角半径
173
+ */
174
+ export type UniNativeBorderRadius = number
175
+ /**
176
+ * 边框圆角半径详细信息
177
+ */
178
+ export type UniNativeBorderRadiuses = {
179
+ /**
180
+ * 左上角圆角半径
181
+ */
182
+ topLeft: UniNativeBorderRadius
183
+ /**
184
+ * 右上角圆角半径
185
+ */
186
+ topRight: UniNativeBorderRadius
187
+ /**
188
+ * 右下角圆角半径
189
+ */
190
+ bottomRight: UniNativeBorderRadius
191
+ /**
192
+ * 左下角圆角半径
193
+ */
194
+ bottomLeft: UniNativeBorderRadius
195
+ }
196
+
197
+
198
+ /**
199
+ * 阴影样式详细信息
200
+ */
201
+ export type UniNativeBoxShadow = {
202
+ /**
203
+ * 阴影是否在元素内部
204
+ * 默认值为false,即阴影在外部
205
+ */
206
+ isInset: boolean
207
+ /**
208
+ * 阴影的 x 偏移量
209
+ */
210
+ offsetX: number
211
+ /**
212
+ * 阴影的 y 偏移量
213
+ */
214
+ offsetY: number
215
+ /**
216
+ * 阴影的模糊半径
217
+ * 默认值为0
218
+ */
219
+ blurRadius: number
220
+ /**
221
+ * 阴影的扩展范围
222
+ * 默认值为0
223
+ */
224
+ spreadRadius: number
225
+ /**
226
+ * 阴影颜色
227
+ * 默认为透明
228
+ */
229
+ color: UniNativeColor
230
+ }
231
+
232
+
233
+ /**
234
+ * 元素溢出行为类型
235
+ */
236
+ export enum UniNativeOverflowType {
237
+ /**
238
+ * 内容被裁减,即不可渲染到元素外部
239
+ */
240
+ Hidden,
241
+ /**
242
+ * 内容不被裁减,即可能渲染到元素外部
243
+ */
244
+ Visible,
245
+ }
246
+
247
+
248
+ /**
249
+ * pointer-event类型
250
+ * 元素是否可以成为事件的target
251
+ */
252
+ export enum UniNativePointerEventType {
253
+ /**
254
+ * 元素可成为事件的target
255
+ */
256
+ Auto,
257
+ /**
258
+ * 元素不可成为事件的target
259
+ */
260
+ None,
261
+ }
262
+
263
+
264
+ /**
265
+ * display类型
266
+ * 元素显示类型
267
+ * 注:鸿蒙/iOS平台都是在C层可以与CSS中的 UniCSSDisplayType 复用
268
+ */
269
+ export enum UniNativeDisplayType {
270
+ /**
271
+ * 元素按弹性布局
272
+ */
273
+ Flex,
274
+ /**
275
+ * 元素不显示
276
+ */
277
+ None,
278
+ }
279
+ //export type UniNativeDisplayType = UniCSSDisplayType
280
+
281
+
282
+ /**
283
+ * position类型
284
+ * 元素位置信息,渲染时需特殊处理fixed的场景
285
+ * 注:鸿蒙/iOS平台都是在C层可以与CSS中的 UniCSSPositionType 复用
286
+ */
287
+ export enum UniNativePositionType {
288
+ /**
289
+ * 当前元素将参与父节点布局,根据 top、right、bottom、left 等属性相对于自身偏移。
290
+ */
291
+ Relative,
292
+ /**
293
+ * 当前元素将不参与父节点布局,布局时不会为该元素创建任何空间,在父元素的内容区域中进行绝对布局,根据 top、right、bottom、left 等属性决定其位置。
294
+ */
295
+ Absolute,
296
+ /**
297
+ * 当前元素将不参与父节点布局,将被视为页面根节点的子元素进行绝对布局,根据 top、right、bottom、left 等属性决定其位置。
298
+ */
299
+ Fixed,
300
+ /**
301
+ *
302
+ */
303
+ Sticky,
304
+ /**
305
+ *
306
+ */
307
+ Static,
308
+ }
309
+ //export type UniNativePositionType = UniCSSPositionType
310
+
311
+
312
+ /**
313
+ * visibility类型
314
+ * 元素是否可见
315
+ * 注:鸿蒙/iOS平台都是在C层可以与CSS中的 UniCSSVisibilityType 复用
316
+ */
317
+ export enum UniNativeVisibilityType {
318
+ /**
319
+ * 元素可见
320
+ */
321
+ Visible,
322
+ /**
323
+ * 元素不可见
324
+ */
325
+ Hidden,
326
+ }
327
+ //export type UniNativeVisibilityType = UniCSSVisibilityType
328
+
329
+
330
+ /**
331
+ * transform类型
332
+ */
333
+ export enum UniNativeTransformType {
334
+ /**
335
+ * 矩阵变换
336
+ */
337
+ Matrix,
338
+ /**
339
+ * 3D矩阵变换
340
+ */
341
+ Matrix3D,
342
+ /**
343
+ * 观察距离变换
344
+ */
345
+ Perspective,
346
+ /**
347
+ * 旋转
348
+ */
349
+ Rotate,
350
+ /**
351
+ * 绕 X 轴旋转
352
+ */
353
+ RotateX,
354
+ /**
355
+ * 绕 Y 轴旋转
356
+ */
357
+ RotateY,
358
+ /**
359
+ * 绕 Z 轴旋转
360
+ */
361
+ RotateZ,
362
+ /**
363
+ * 3D旋转
364
+ */
365
+ Rotate3D,
366
+ /**
367
+ * 缩放
368
+ */
369
+ Scale,
370
+ /**
371
+ * X 轴方向缩放
372
+ */
373
+ ScaleX,
374
+ /**
375
+ * Y 轴方向缩放
376
+ */
377
+ ScaleY,
378
+ /**
379
+ * Z 轴方向缩放
380
+ */
381
+ ScaleZ,
382
+ /**
383
+ * 3D缩放
384
+ */
385
+ Scale3D,
386
+ /**
387
+ * 倾斜(扭曲)
388
+ */
389
+ Skew,
390
+ /**
391
+ * 沿 X 轴倾斜
392
+ */
393
+ SkewX,
394
+ /**
395
+ * 沿 Y 轴倾斜
396
+ */
397
+ SkewY,
398
+ /**
399
+ * 移动
400
+ */
401
+ Translate,
402
+ /**
403
+ * 沿 X 轴移动
404
+ */
405
+ TranslateX,
406
+ /**
407
+ * 沿 Y 轴移动
408
+ */
409
+ TranslateY,
410
+ /**
411
+ * 沿 Z 轴移动
412
+ */
413
+ TranslateZ,
414
+ /**
415
+ * 3D移动
416
+ */
417
+ Translate3D,
418
+ }
419
+
420
+
421
+ /**
422
+ * 插槽名称
423
+ */
424
+ export enum UniNativeSlotType {
425
+ /**
426
+ * 无插槽
427
+ */
428
+ None,
429
+ /**
430
+ * 下拉刷新插槽
431
+ * scroll-view组件的子组件使用
432
+ */
433
+ Refresher
434
+ }
435
+
@@ -0,0 +1,34 @@
1
+ import { UniNativeBaseView, } from "./UniNativeBaseView"
2
+ import { UniImageModeType } from "./UniImageElement";
3
+
4
+
5
+
6
+ /**
7
+ * 图片组件 image
8
+ */
9
+ export interface UniNativeImageView extends UniNativeBaseView {
10
+
11
+ /**
12
+ * 设置图片资源地址
13
+ * 仅Android平台支持
14
+ * 其它平台通过UniElement在c层加载图片后更新
15
+ */
16
+ src(src: string): void;
17
+
18
+ /**
19
+ * 设置图片裁剪、缩放模式
20
+ */
21
+ mode(value: UniImageModeType): void;
22
+
23
+ /**
24
+ * 设置是否懒加载
25
+ */
26
+ lazyLoad(value: boolean): void;
27
+
28
+ /**
29
+ * 图片显示动画效果
30
+ */
31
+ fadeShow(value: boolean): void;
32
+ }
33
+
34
+
@@ -0,0 +1,42 @@
1
+ import { UniNativeBaseView, } from "./UniNativeBaseView"
2
+
3
+
4
+
5
+ /**
6
+ * 滚动容器组件 scroll-view
7
+ */
8
+ export interface UniNativeScrollView extends UniNativeBaseView {
9
+
10
+
11
+ }
12
+
13
+
14
+ /**
15
+ * scroll-view组件构造参数
16
+ */
17
+ export type UniNativeScrollViewOptions = {
18
+ direction: UniNativeScrollViewDirectionType
19
+ }
20
+
21
+
22
+ /**
23
+ * scroll-view组件滚动方向枚举值
24
+ */
25
+ export enum UniNativeScrollViewDirectionType {
26
+ /**
27
+ * 禁止滚动
28
+ */
29
+ None,
30
+ /**
31
+ * 竖向滚动
32
+ */
33
+ Vertical,
34
+ /**
35
+ * 横向滚动
36
+ */
37
+ Horizontal,
38
+ /**
39
+ * 横向竖向都可滚动
40
+ */
41
+ All,
42
+ }
@@ -0,0 +1,25 @@
1
+ import { UniNativeBaseView, } from "./UniNativeBaseView"
2
+ import { UniTextLayout } from "./index"
3
+
4
+
5
+
6
+ /**
7
+ * 基本视图容器View
8
+ */
9
+ /**
10
+ * 文本View
11
+ */
12
+ export interface UniNativeTextView extends UniNativeBaseView {
13
+ /**
14
+ * 设置文本内容
15
+ */
16
+ content(value: UniTextLayout): UniNativeTextView
17
+
18
+
19
+ /**
20
+ * 属性
21
+ */
22
+ }
23
+
24
+
25
+
@@ -0,0 +1,51 @@
1
+ import { UniNativeBaseView, } from "./UniNativeBaseView"
2
+
3
+
4
+
5
+ /**
6
+ * 基本视图容器 view
7
+ */
8
+ export interface UniNativeView extends UniNativeBaseView {
9
+ /**
10
+ * 管理子View
11
+ */
12
+ /**
13
+ * 添加子View
14
+ */
15
+ append(view: UniNativeBaseView): UniNativeView
16
+ /**
17
+ * 删除子View
18
+ */
19
+ removeChild(view: UniNativeBaseView): UniNativeView
20
+ /**
21
+ * 在指定子View前插入
22
+ * 如未指定ref则添加到末尾,与append效果一致
23
+ */
24
+ insertBefore(view: UniNativeBaseView, ref: UniNativeBaseView|null): UniNativeView
25
+
26
+
27
+ /**
28
+ * View的属性相关API
29
+ */
30
+ /**
31
+ * 是否阻止本节点的祖先节点出现点击态
32
+ * 默认值为false
33
+ */
34
+ hoverStopPropagation(value: boolean): UniNativeView
35
+ /**
36
+ * 按住后多久出现点击态,单位为毫秒
37
+ * 默认值为50ms
38
+ */
39
+ hoverStartTime(value: number): UniNativeView
40
+ /**
41
+ * 手指松开后点击态保留时间,单位为毫秒
42
+ * 默认值为400ms
43
+ */
44
+ hoverStayTime(value: number): UniNativeView
45
+
46
+
47
+ }
48
+
49
+
50
+ export type UniNativeViewStyles = Map<string, any>
51
+
@@ -0,0 +1,22 @@
1
+
2
+ /**
3
+ * 原生View类型
4
+ */
5
+ export enum UniNativeViewType {
6
+ /**
7
+ * 基本视图容器View
8
+ */
9
+ View,
10
+ /**
11
+ * 文本View
12
+ */
13
+ Text,
14
+ /**
15
+ * 图片View
16
+ */
17
+ Image,
18
+ /**
19
+ * 可滚动视图容器View
20
+ */
21
+ ScrollView
22
+ }
@@ -0,0 +1,55 @@
1
+ import { UniElement } from './index'
2
+ import { UniElementType, UniElementStyles } from './UniElementType'
3
+ import { UniViewElement } from './index'
4
+ import { UniTextElement } from './index'
5
+ import { UniImageElement } from './index'
6
+ import { UniNativeView } from './UniNativeView'
7
+ import { UniNativeTextView } from './UniNativeTextView'
8
+ import { UniNativeImageView } from './UniNativeImageView'
9
+ import { UniNativeScrollView, UniNativeScrollViewOptions } from './UniNativeScrollView'
10
+ import { UniNativeCustomView } from './UniNativeCustomView'
11
+
12
+ declare global {
13
+ /**
14
+ * 页面对象
15
+ */
16
+ interface UniPage {
17
+
18
+ /**
19
+ * 创建UniElement
20
+ * 仅内部使用
21
+ * @param type - UniElementType类型
22
+ * @param flatten - Element是否被拍平(扁平化)
23
+ * true表示可拍平,false表示不可拍平,默认值false
24
+ * @param style - 同时设置多个CSS样式
25
+ * 注意:在Android平台仅支持排版CSS,为了各平台统一,编译生成的代码应该只设置排版相关CSS
26
+ */
27
+ createElement(type: UniElementType, flatten: boolean): UniElement
28
+ createElement(type: UniElementType, flatten: boolean, style: UniElementStyles): UniElement
29
+ createViewElement(flatten: boolean, style?: UniElementStyles | null): UniViewElement
30
+ createTextElement(flatten: boolean, style?: UniElementStyles | null): UniTextElement
31
+ createImageElement(flatten: boolean, style?: UniElementStyles | null): UniImageElement
32
+ createComment(data: string): UniElement
33
+
34
+ /**
35
+ * 创建原生View
36
+ * @param flatten 原生View是否被拍平(扁平化),true表示可拍平,false表示不可拍平,默认值false
37
+ */
38
+ createNativeView(flatten: boolean): UniNativeView
39
+ createNativeTextView(flatten: boolean): UniNativeTextView
40
+ createNativeImageView(flatten: boolean): UniNativeImageView
41
+ createNativeScrollView(options: UniNativeScrollViewOptions, flatten: boolean): UniNativeScrollView
42
+ createNativeCustomView(flatten: boolean): UniNativeCustomView
43
+ // 废弃通过类型创建NativeView的API,改用上面创建指定类型的原生View
44
+ // createNativeView(type: UniNativeViewType, flatten: boolean): UniNativeBaseView
45
+ // createNativeView<T extends UniNativeBaseView>(type: UniNativeViewType, flatten: boolean): T
46
+
47
+
48
+ /**
49
+ * 定义CSS变量
50
+ * @param key - css变量名称
51
+ * @param value - css变量值,空字符串则表示移除变量定义
52
+ */
53
+ defineStyleVariable(key: string, value: string): void
54
+ }
55
+ }
@@ -0,0 +1,13 @@
1
+ import { UniElement } from './UniElement'
2
+
3
+ declare global {
4
+
5
+ /**
6
+ * UniScrollViewElement
7
+ */
8
+ interface UniScrollViewElement extends UniElement {
9
+
10
+
11
+ }
12
+ }
13
+
@@ -0,0 +1,20 @@
1
+ import { UniElement } from './UniElement'
2
+ import { UniTextLayout } from './index'
3
+
4
+
5
+ declare global {
6
+ /**
7
+ * UniTextElement
8
+ */
9
+ interface UniTextElement extends UniElement {
10
+
11
+ /**
12
+ * 设置文本内容
13
+ * Android平台仅在kotlin层实现,用于开放给开发者使用
14
+ * 鸿蒙/iOS平台的在c层实现,设置后需同步更新给NativeView
15
+ * 鸿蒙/iOS平台在ArkTS/Swift包装调用c层的实现
16
+ */
17
+ setLayoutText(text: UniTextLayout): void;
18
+ }
19
+ }
20
+