@dcloudio/uni-app-x 0.4.6 → 0.5.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.
Files changed (116) hide show
  1. package/README.md +39 -0
  2. package/package.json +5 -3
  3. package/types/app.d.ts +36 -82
  4. package/types/native/CSSStyleDeclaration.d.ts +2 -2
  5. package/types/native/CustomEvent.d.ts +0 -2
  6. package/types/native/DOMRect.d.ts +4 -4
  7. package/types/native/DomNode.d.ts +48 -0
  8. package/types/native/DrawableContext.d.ts +42 -16
  9. package/types/native/Element.d.ts +234 -0
  10. package/types/native/Event.d.ts +14 -3
  11. package/types/native/IDocument.d.ts +6 -6
  12. package/types/native/IPage.d.ts +27 -11
  13. package/types/native/IPageManager.d.ts +2 -2
  14. package/types/native/ITabsNode.d.ts +4 -4
  15. package/types/native/IUniError.d.ts +20 -0
  16. package/types/native/IWebViewNode.d.ts +2 -2
  17. package/types/native/InputBlurEvent.d.ts +13 -0
  18. package/types/native/InputConfirmEvent.d.ts +13 -0
  19. package/types/native/InputEvent.d.ts +21 -0
  20. package/types/native/InputFocusEvent.d.ts +17 -0
  21. package/types/native/InputKeyboardHeightChangeEvent.d.ts +17 -0
  22. package/types/native/MouseEvent.d.ts +13 -1
  23. package/types/native/NestedPreScrollEvent.d.ts +23 -0
  24. package/types/native/ScrollToLowerEvent.d.ts +4 -1
  25. package/types/native/ScrollToUpperEvent.d.ts +5 -2
  26. package/types/native/SourceError.d.ts +0 -2
  27. package/types/native/StartNestedScrollEvent.d.ts +12 -0
  28. package/types/native/SwiperAnimationFinishEvent.d.ts +11 -0
  29. package/types/native/SwiperChangeEvent.d.ts +11 -0
  30. package/types/native/SwiperTransitionEvent.d.ts +11 -0
  31. package/types/native/TextareaBlurEvent.d.ts +17 -0
  32. package/types/native/TextareaFocusEvent.d.ts +17 -0
  33. package/types/native/TextareaLineChangeEvent.d.ts +21 -0
  34. package/types/native/TouchEvent.d.ts +5 -1
  35. package/types/native/UniError.d.ts +7 -3
  36. package/types/native/index.d.ts +18 -3
  37. package/types/page.d.ts +57 -212
  38. package/types/uni/core/index.d.ts +9 -7
  39. package/types/uni/core/lib/base/event/interface.d.ts +4 -4
  40. package/types/uni/core/lib/lifecycle/interface.d.ts +1 -1
  41. package/types/uni/core/lib/performance/interface.d.ts +0 -20
  42. package/types/uni/core/lib/route/index.d.ts +0 -10
  43. package/types/uni/core/lib/route/interface.d.ts +1805 -10
  44. package/types/uni/core/lib/ui/create-selector-query/interface.d.ts +242 -2
  45. package/types/uni/core/lib/ui/get-element-by-id/index.d.ts +9 -0
  46. package/types/uni/core/lib/ui/get-element-by-id/interface.d.ts +72 -0
  47. package/types/uni/core/lib/ui/load-font-face/interface.d.ts +486 -3
  48. package/types/uni/core/lib/ui/page-scroll-to/index.d.ts +0 -2
  49. package/types/uni/core/lib/ui/page-scroll-to/interface.d.ts +93 -9
  50. package/types/uni/core/lib/ui/pull-down-refresh/index.d.ts +0 -2
  51. package/types/uni/core/lib/ui/pull-down-refresh/interface.d.ts +2 -5
  52. package/types/uni/core/lib/ui/set-navigation-bar-color/interface.d.ts +373 -4
  53. package/types/uni/core/lib/ui/tab-bar/index.d.ts +2 -18
  54. package/types/uni/core/lib/ui/tab-bar/interface.d.ts +32 -35
  55. package/types/uni/index.d.ts +2 -1
  56. package/types/uni/{ext → uts-plugin-api}/index.d.ts +18 -17
  57. package/types/uni/{ext → uts-plugin-api}/lib/uni-audio/utssdk/interface.d.ts +2 -2
  58. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/index.d.ts +11 -0
  59. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +98 -0
  60. package/types/uni/{ext → uts-plugin-api}/lib/uni-exit/utssdk/interface.d.ts +1 -1
  61. package/types/uni/{ext → uts-plugin-api}/lib/uni-file-manager/utssdk/interface.d.ts +4 -32
  62. package/types/uni/{ext → uts-plugin-api}/lib/uni-getAccessibilityInfo/utssdk/interface.d.ts +1 -1
  63. package/types/uni/{ext → uts-plugin-api}/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +108 -10
  64. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +233 -0
  65. package/types/uni/{ext → uts-plugin-api}/lib/uni-getDeviceInfo/utssdk/interface.d.ts +58 -46
  66. package/types/uni/{ext → uts-plugin-api}/lib/uni-getLocation-system/utssdk/index.d.ts +0 -2
  67. package/types/uni/{ext → uts-plugin-api}/lib/uni-getLocation-system/utssdk/interface.d.ts +14 -10
  68. package/types/uni/{ext → uts-plugin-api}/lib/uni-getNetworkType/utssdk/interface.d.ts +8 -5
  69. package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/interface.d.ts +213 -0
  70. package/types/uni/{ext → uts-plugin-api}/lib/uni-getSystemInfo/utssdk/interface.d.ts +108 -163
  71. package/types/uni/{ext → uts-plugin-api}/lib/uni-getSystemSetting/utssdk/interface.d.ts +3 -3
  72. package/types/uni/{ext → uts-plugin-api}/lib/uni-media/utssdk/index.d.ts +0 -20
  73. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +794 -0
  74. package/types/uni/{ext → uts-plugin-api}/lib/uni-network/utssdk/app-ios/interface.d.ts +60 -19
  75. package/types/uni/{ext → uts-plugin-api}/lib/uni-network/utssdk/index.d.ts +4 -0
  76. package/types/uni/{ext → uts-plugin-api}/lib/uni-network/utssdk/interface.d.ts +138 -49
  77. package/types/uni/{ext → uts-plugin-api}/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +8 -5
  78. package/types/uni/{ext → uts-plugin-api}/lib/uni-prompt/utssdk/interface.d.ts +6 -6
  79. package/types/uni/{ext → uts-plugin-api}/lib/uni-storage/utssdk/index.d.ts +0 -10
  80. package/types/uni/{ext → uts-plugin-api}/lib/uni-storage/utssdk/interface.d.ts +33 -117
  81. package/types/uni/{ext → uts-plugin-api}/lib/uni-websocket/utssdk/index.d.ts +2 -0
  82. package/types/uni/{ext → uts-plugin-api}/lib/uni-websocket/utssdk/interface.d.ts +60 -35
  83. package/types/uni/uts-plugin-component/index.d.ts +1 -0
  84. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/index.d.ts +15 -0
  85. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +171 -0
  86. package/types/uni-cloud/index.d.ts +59 -333
  87. package/types/uni-cloud/interface.d.ts +786 -0
  88. package/types/vue/CheckboxGroupChangeEvent.d.ts +1 -1
  89. package/types/vue/PickerViewChangeEvent.d.ts +1 -1
  90. package/types/vue/ProgressActiveendEvent.d.ts +1 -1
  91. package/types/vue/RadioGroupChangeEvent.d.ts +1 -1
  92. package/types/vue/SliderChangeEvent.d.ts +10 -1
  93. package/types/vue/SwitchChangeEvent.d.ts +1 -1
  94. package/uts-plugin.d.ts +10 -0
  95. package/.env +0 -3
  96. package/tsconfig.json +0 -5
  97. package/types/native/INode.d.ts +0 -181
  98. package/types/native/UTSError.d.ts +0 -15
  99. package/types/native/UTSPromise.d.ts +0 -74
  100. package/types/uni/ext/lib/uni-file-manager/utssdk/index.d.ts +0 -35
  101. package/types/uni/ext/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +0 -120
  102. package/types/uni/ext/lib/uni-getRecorderManager/utssdk/interface.d.ts +0 -213
  103. package/types/uni/ext/lib/uni-media/utssdk/interface.d.ts +0 -877
  104. /package/types/uni/{ext → uts-plugin-api}/lib/uni-audio/utssdk/index.d.ts +0 -0
  105. /package/types/uni/{ext → uts-plugin-api}/lib/uni-exit/utssdk/index.d.ts +0 -0
  106. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getAccessibilityInfo/utssdk/index.d.ts +0 -0
  107. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getAppAuthorizeSetting/utssdk/index.d.ts +0 -0
  108. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getAppBaseInfo/utssdk/index.d.ts +0 -0
  109. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getDeviceInfo/utssdk/index.d.ts +0 -0
  110. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getNetworkType/utssdk/index.d.ts +0 -0
  111. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getRecorderManager/utssdk/index.d.ts +0 -0
  112. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getSystemInfo/utssdk/index.d.ts +0 -0
  113. /package/types/uni/{ext → uts-plugin-api}/lib/uni-getSystemSetting/utssdk/index.d.ts +0 -0
  114. /package/types/uni/{ext → uts-plugin-api}/lib/uni-network/utssdk/app-ios/index.d.ts +0 -0
  115. /package/types/uni/{ext → uts-plugin-api}/lib/uni-openAppAuthorizeSetting/utssdk/index.d.ts +0 -0
  116. /package/types/uni/{ext → uts-plugin-api}/lib/uni-prompt/utssdk/index.d.ts +0 -0
@@ -0,0 +1,794 @@
1
+
2
+
3
+ export type ChooseImageSuccessCallback = {
4
+ /**
5
+ * 调用API的名称
6
+ */
7
+ errSubject : string,
8
+ errMsg : string,
9
+ tempFilePaths : Array<string>,
10
+ tempFiles : any
11
+ }
12
+
13
+ export type ChooseImageCropOptions = {
14
+ /**
15
+ * 裁剪的宽度,单位为px,用于计算裁剪宽高比。
16
+ */
17
+ width : number;
18
+ /**
19
+ * 裁剪的高度,单位为px,用于计算裁剪宽高比。
20
+ */
21
+ height : number;
22
+ /**
23
+ * 取值范围为1-100,数值越小,质量越低(仅对jpg格式有效)。默认值为80。
24
+ * @defaultValue 80
25
+ */
26
+ quality : (number) | null;
27
+ /**
28
+ * 是否将width和height作为裁剪保存图片真实的像素值。默认值为true。注:设置为false时在裁剪编辑界面显示图片的像素值,设置为true时不显示。
29
+ * @type boolean
30
+ */
31
+ resize : (boolean) | null;
32
+ }
33
+
34
+ export type ChooseImageOptions = {
35
+ /**
36
+ * 最多可以选择的图片张数,app端不限制,微信小程序最多可支持20个。
37
+ * @defaultValue 9
38
+ */
39
+ count ?: (number) | null,
40
+ /**
41
+ * original 原图,compressed 压缩图,默认二者都有
42
+ * @type string | string []
43
+ * @defaultValue ['original','compressed']
44
+ */
45
+ sizeType ?: (string[]) | null,
46
+ /**
47
+ * album 从相册选图,camera 使用相机,默认二者都有
48
+ * @defaultValue ['album','camera']
49
+ */
50
+ sourceType ?: (string[]) | null,
51
+ /**
52
+ * 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。仅H5支持
53
+ */
54
+ extension ?: (string[]) | null,
55
+ /**
56
+ * 图像裁剪参数,设置后 sizeType 失效。
57
+ */
58
+ crop ?: (ChooseImageCropOptions) | null,
59
+ /**
60
+ * 成功则返回图片的本地文件路径列表 tempFilePaths
61
+ */
62
+ success ?: ((callback : ChooseImageSuccessCallback) => void) | null,
63
+ /**
64
+ * 接口调用失败的回调函数
65
+ */
66
+ fail ?: ((callback : UniError) => void) | null,
67
+ /**
68
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
69
+ */
70
+ complete ?: ((callback : any) => void) | null
71
+ }
72
+
73
+ export type ChooseImage = (options : ChooseImageOptions) => void
74
+
75
+ export type PreviewImageSuccessCallback = {
76
+ errSubject : string,
77
+ errMsg : string
78
+ }
79
+
80
+ export type LongPressActionsSuccessData = {
81
+ /**
82
+ * 接口调用失败的回调函数
83
+ */
84
+ tapIndex : number,
85
+ /**
86
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
87
+ */
88
+ index : number
89
+ };
90
+ export type LongPressActionsOptions = {
91
+ /**
92
+ * 按钮的文字数组
93
+ */
94
+ itemList : string[],
95
+ /**
96
+ * 按钮的文字颜色,字符串格式,默认为"#000000"
97
+ */
98
+ itemColor : string | null,
99
+ /**
100
+ * 接口调用成功的回调函数
101
+ */
102
+ success : ((result : LongPressActionsSuccessData) => void) | null,
103
+ /**
104
+ * 接口调用失败的回调函数
105
+ */
106
+ fail : ((result : any) => void) | null,
107
+ /**
108
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
109
+ */
110
+ complete : ((result : any) => void) | null
111
+ };
112
+
113
+ export type PreviewImageOptions = {
114
+ /**
115
+ * 当前显示图片的链接,不填则默认为 urls 的第一张
116
+ */
117
+ count ?: string | null,
118
+ /**
119
+ * current 为当前显示图片的链接/索引值,不填或填写的值无效则为 urls 的第一张。App平台在 1.9.5至1.9.8之间,current为必填。不填会报错
120
+ * @type string | number
121
+ */
122
+ current ?: any | null,
123
+ /**
124
+ * 需要预览的图片链接列表
125
+ */
126
+ urls : string[],
127
+ /**
128
+ * 图片指示器样式
129
+ * - default: 底部圆点指示器
130
+ * - number: 顶部数字指示器
131
+ * - none: 不显示指示器
132
+ * @type 'default' | 'number' | 'none'
133
+ */
134
+ indicator ?: string | null,
135
+ /**
136
+ * 是否可循环预览
137
+ * @type boolean
138
+ */
139
+ loop ?: boolean | null,
140
+ /**
141
+ * 长按图片显示操作菜单,如不填默认为保存相册,1.9.5 起支持。
142
+ */
143
+ longPressActions ?: LongPressActionsOptions | null,
144
+ /**
145
+ * 接口调用成功的回调函数
146
+ */
147
+ success ?: ((result : PreviewImageSuccessCallback) => void) | null,
148
+ /**
149
+ * 接口调用失败的回调函数
150
+ */
151
+ fail ?: ((result : UniError) => void) | null,
152
+ /**
153
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
154
+ */
155
+ complete ?: ((result : any) => void) | null
156
+ };
157
+
158
+ export type PreviewImage = (options : PreviewImageOptions) => void;
159
+
160
+ export type ClosePreviewImage = (options : ClosePreviewImageOptions) => void;
161
+ export type ClosePreviewImageSuccessCallback = {
162
+ /**
163
+ * 错误信息
164
+ */
165
+ errMsg : string
166
+ };
167
+
168
+ export type ClosePreviewImageOptions = {
169
+ /**
170
+ * 接口调用成功的回调函数
171
+ */
172
+ success ?: ((result : ClosePreviewImageSuccessCallback) => void) | null,
173
+ /**
174
+ * 接口调用失败的回调函数
175
+ */
176
+ fail ?: ((result : UniError) => void) | null,
177
+ /**
178
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
179
+ */
180
+ complete ?: ((result : any) => void) | null
181
+ };
182
+
183
+ export type GetImageInfo = (options : GetImageInfoOptions) => void;
184
+ export type GetImageInfoSuccessCallback = {
185
+ /**
186
+ * 图片宽度,单位px
187
+ */
188
+ width : number,
189
+ /**
190
+ * 图片高度,单位px
191
+ */
192
+ height : number,
193
+ /**
194
+ * 返回图片的本地路径
195
+ */
196
+ path : string,
197
+ /**
198
+ * 返回图片的方向
199
+ */
200
+ orientation : string | null,
201
+ /**
202
+ * 返回图片的格式
203
+ */
204
+ type : string | null
205
+ };
206
+
207
+ export type GetImageInfoOptions = {
208
+ /**
209
+ * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径
210
+ */
211
+ src : string,
212
+ /**
213
+ * 接口调用成功的回调函数
214
+ */
215
+ success ?: ((result : GetImageInfoSuccessCallback) => void) | null,
216
+ /**
217
+ * 接口调用失败的回调函数
218
+ */
219
+ fail ?: ((result : UniError) => void) | null,
220
+ /**
221
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
222
+ */
223
+ complete ?: ((result : any) => void) | null
224
+ };
225
+
226
+ export type SaveImageToPhotosAlbum = (options : SaveImageToPhotosAlbumOptions) => void;
227
+
228
+ export type SaveImageToPhotosAlbumSuccessCallback = {
229
+ /**
230
+ * 保存到相册的图片路径
231
+ */
232
+ path : string
233
+ };
234
+
235
+ export type SaveImageToPhotosAlbumOptions = {
236
+ /**
237
+ * 图片文件路径,可以是临时文件路径也可以是永久文件路径,不支持网络图片路径
238
+ */
239
+ filePath : string,
240
+ /**
241
+ * 接口调用成功的回调函数
242
+ */
243
+ success ?: ((result : SaveImageToPhotosAlbumSuccessCallback) => void) | null,
244
+ /**
245
+ * 接口调用失败的回调函数
246
+ */
247
+ fail ?: ((result : UniError) => void) | null,
248
+ /**
249
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
250
+ */
251
+ complete ?: ((result : any) => void) | null
252
+ };
253
+ export type CompressImage = (options : CompressImageOptions) => void;
254
+ export type CompressImageSuccessCallback = {
255
+ /**
256
+ * 压缩后图片的临时文件路径
257
+ */
258
+ tempFilePath : string
259
+ };
260
+ export type CompressImageOptions = {
261
+ /**
262
+ * 图片路径,图片的路径,可以是相对路径、临时文件路径、存储文件路径
263
+ */
264
+ src : string,
265
+ /**
266
+ * 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效)
267
+ */
268
+ quality ?: number | null,
269
+ /**
270
+ * 旋转度数,范围0~360
271
+ */
272
+ rotate ?: number | null,
273
+ /**
274
+ * 缩放图片的宽度
275
+ */
276
+ width ?: string | null,
277
+ /**
278
+ * 缩放图片的高度
279
+ */
280
+ height ?: string | null,
281
+ /**
282
+ * 压缩后图片的高度,单位为px,若不填写则默认以compressedWidth为准等比缩放
283
+ */
284
+ compressedHeight ?: number | null,
285
+ /**
286
+ * 压缩后图片的宽度,单位为px,若不填写则默认以compressedHeight为准等比缩放。
287
+ */
288
+ compressedWidth ?: number | null,
289
+ /**
290
+ * 接口调用成功的回调函数
291
+ */
292
+ success ?: ((result : CompressImageSuccessCallback) => void) | null,
293
+ /**
294
+ * 接口调用失败的回调函数
295
+ */
296
+ fail ?: ((result : UniError) => void) | null,
297
+ /**
298
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
299
+ */
300
+ complete ?: ((result : any) => void) | null
301
+ };
302
+
303
+ export type ChooseVideoSuccessCallback = {
304
+ /**
305
+ * 选定视频的临时文件路径
306
+ */
307
+ tempFilePath : string,
308
+ /**
309
+ * 选定的视频文件,仅H5支持
310
+ */
311
+ // tempFile: File|null,
312
+ /**
313
+ * 选定视频的时间长度
314
+ */
315
+ duration : number,
316
+ /**
317
+ * 选定视频的数据量大小
318
+ */
319
+ size : number,
320
+ /**
321
+ * 返回选定视频的长
322
+ */
323
+ height : number,
324
+ /**
325
+ * 返回选定视频的宽
326
+ */
327
+ width : number,
328
+ /**
329
+ * 包含扩展名的文件名称(仅H5支持)
330
+ */
331
+ // name: string | null
332
+ };
333
+
334
+ export type ChooseVideoOptions = {
335
+ /**
336
+ * album 从相册选视频,camera 使用相机拍摄,默认为:['album', 'camera']
337
+ */
338
+ sourceType ?: (string[]) | null,
339
+ /**
340
+ * 是否压缩所选的视频源文件,默认值为true,需要压缩
341
+ * @type boolean
342
+ */
343
+ compressed ?: boolean | null,
344
+ /**
345
+ * 拍摄视频最长拍摄时间,单位秒。最长支持 60 秒
346
+ */
347
+ maxDuration ?: number | null,
348
+ /**
349
+ * 摄像切换
350
+ * - front: 前置摄像头
351
+ * - back: 后置摄像头
352
+ * @type 'front' | 'back'
353
+ */
354
+ camera ?: string | null,
355
+ /**
356
+ * 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。
357
+ */
358
+ extension ?: (string[]) | null,
359
+ /**
360
+ * 接口调用成功,返回视频文件的临时文件路径,详见返回参数说明
361
+ */
362
+ success ?: ((result : ChooseVideoSuccessCallback) => void) | null,
363
+ /**
364
+ * 接口调用失败的回调函数
365
+ */
366
+ fail ?: ((result : UniError) => void) | null,
367
+ /**
368
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
369
+ */
370
+ complete ?: ((result : any) => void) | null
371
+ };
372
+
373
+ export type ChooseVideo = (options : ChooseVideoOptions) => void;
374
+
375
+ export type GetVideoInfoSuccessCallback = {
376
+ /**
377
+ * 画面方向
378
+ */
379
+ orientation : string | null,
380
+ /**
381
+ * 视频格式
382
+ */
383
+ type : string | null,
384
+ /**
385
+ * 视频长度
386
+ */
387
+ duration : number,
388
+ /**
389
+ * 视频大小,单位 kB
390
+ */
391
+ size : number,
392
+ /**
393
+ * 视频的长,单位 px
394
+ */
395
+ height : number,
396
+ /**
397
+ * 视频的宽,单位 px
398
+ */
399
+ width : number,
400
+ /**
401
+ * 视频帧率
402
+ */
403
+ fps : number | null,
404
+ /**
405
+ * 视频码率,单位 kbps
406
+ */
407
+ bitrate : number | null
408
+ };
409
+
410
+ export type GetVideoInfoOptions = {
411
+ /**
412
+ * 视频文件路径,可以是临时文件路径也可以是永久文件路径
413
+ */
414
+ src : string,
415
+ /**
416
+ * 接口调用成功的回调函数
417
+ */
418
+ success ?: ((result : GetVideoInfoSuccessCallback) => void) | null,
419
+ /**
420
+ * 接口调用失败的回调函数
421
+ */
422
+ fail ?: ((result : UniError) => void) | null,
423
+ /**
424
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
425
+ */
426
+ complete ?: ((result : any) => void) | null
427
+ };
428
+
429
+ export type GetVideoInfo = (options : GetVideoInfoOptions) => void;
430
+
431
+ export type SaveVideoToPhotosAlbumSuccessCallback = {};
432
+
433
+ export type SaveVideoToPhotosAlbumOptions = {
434
+ /**
435
+ * 视频文件路径,可以是临时文件路径也可以是永久文件路径
436
+ */
437
+ filePath : string,
438
+ /**
439
+ * 接口调用成功的回调函数
440
+ */
441
+ success ?: ((result : SaveVideoToPhotosAlbumSuccessCallback) => void) | null,
442
+ /**
443
+ * 接口调用失败的回调函数
444
+ */
445
+ fail ?: ((result : UniError) => void) | null,
446
+ /**
447
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
448
+ */
449
+ complete ?: ((result : any) => void) | null
450
+ };
451
+
452
+ export type SaveVideoToPhotosAlbum = (options : SaveVideoToPhotosAlbumOptions) => void;
453
+
454
+ export type CompressVideoSuccessCallback = {
455
+ /**
456
+ * 压缩后的临时文件地址
457
+ */
458
+ tempFilePath : string,
459
+ /**
460
+ * 压缩后的大小,单位 kB
461
+ */
462
+ size : number
463
+ };
464
+
465
+ export type CompressVideoOptions = {
466
+ /**
467
+ * 视频文件路径,可以是临时文件路径也可以是永久文件路径
468
+ */
469
+ src : string,
470
+ /**
471
+ * 压缩质量
472
+ * - low: 低
473
+ * - medium: 中
474
+ * - high: 高
475
+ * @type 'low' | 'medium' | 'high'
476
+ */
477
+ quality ?: string | null,
478
+ /**
479
+ * 码率,单位 kbps
480
+ */
481
+ bitrate ?: number | null,
482
+ /**
483
+ * 帧率
484
+ */
485
+ fps ?: number | null,
486
+ /**
487
+ * 相对于原视频的分辨率比例,取值范围(0, 1]
488
+ */
489
+ resolution ?: number | null,
490
+ /**
491
+ * 接口调用成功的回调函数
492
+ */
493
+ success ?: ((result : CompressVideoSuccessCallback) => void) | null,
494
+ /**
495
+ * 接口调用失败的回调函数
496
+ */
497
+ fail ?: ((result : UniError) => void) | null,
498
+ /**
499
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
500
+ */
501
+ complete ?: ((result : any) => void) | null
502
+ };
503
+
504
+ export type CompressVideo = (options : CompressVideoOptions) => void;
505
+
506
+ export interface Uni {
507
+ /**
508
+ * 从本地相册选择图片或使用相机拍照
509
+ * @description 从本地相册选择图片或使用相机拍照
510
+ * @uniPlatform {
511
+ * "app": {
512
+ * "android": {
513
+ * "osVer": "4.4",
514
+ * "uniVer": "√",
515
+ * "unixVer": "3.9.0"
516
+ * }
517
+ * }
518
+ * }
519
+ * @uniVueVersion 2,3
520
+ * @example
521
+ * ```typescript
522
+ * uni.chooseImage({
523
+ * count:3,
524
+ * success(e){
525
+ * console.log(JSON.stringify(e))
526
+ * }
527
+ * })
528
+ * ```
529
+ * @tutorial http://uniapp.dcloud.io/api/media/image?id=chooseimage
530
+ * @autotest {
531
+ generated:false
532
+ }
533
+ */
534
+ chooseImage(options : ChooseImageOptions) : void;
535
+ /**
536
+ * 预览图片
537
+ * @description 预览图片
538
+ * @uniPlatform {
539
+ * "app": {
540
+ * "android": {
541
+ * "osVer": "4.4",
542
+ * "uniVer": "√",
543
+ * "unixVer": "3.9.0"
544
+ * }
545
+ * }
546
+ * }
547
+ * @uniVueVersion 2,3
548
+ * @example
549
+ * ```typescript
550
+ * uni.previewImage({
551
+ * urls:['/static/a.jpg','/static/b.jpg'],
552
+ * success(e){
553
+ * console.log(JSON.stringify(e))
554
+ * }
555
+ * })
556
+ * ```
557
+ * @tutorial http://uniapp.dcloud.io/api/media/image?id=previewimage
558
+ * @autotest {
559
+ generated:false
560
+ }
561
+ */
562
+ previewImage(options : PreviewImageOptions) : void;
563
+ /**
564
+ * 关闭图片预览
565
+ * @description 关闭图片预览
566
+ * @uniPlatform {
567
+ * "app": {
568
+ * "android": {
569
+ * "osVer": "4.4",
570
+ * "uniVer": "√",
571
+ * "unixVer": "3.9.0"
572
+ * }
573
+ * }
574
+ * }
575
+ * @uniVueVersion 2,3
576
+ * @example
577
+ * ```typescript
578
+ * uni.closePreviewImage({
579
+ * success(e){
580
+ * console.log(JSON.stringify(e))
581
+ * }
582
+ * })
583
+ * ```
584
+ * @tutorial http://uniapp.dcloud.io/api/media/image?id=closepreviewimage
585
+ * @autotest {
586
+ generated:false
587
+ }
588
+ */
589
+ closePreviewImage(options : ClosePreviewImageOptions) : void;
590
+ /**
591
+ * 获取图片信息
592
+ * @description 获取图片信息
593
+ * @uniPlatform {
594
+ * "app": {
595
+ * "android": {
596
+ * "osVer": "4.4",
597
+ * "uniVer": "√",
598
+ * "unixVer": "3.9.0"
599
+ * }
600
+ * }
601
+ * }
602
+ * @uniVueVersion 2,3
603
+ * @example
604
+ * ```typescript
605
+ * uni.getImageInfo({
606
+ * src:'/static/a.jpg',
607
+ * success(e){
608
+ * console.log(JSON.stringify(e))
609
+ * },
610
+ * })
611
+ * ```
612
+ * @tutorial http://uniapp.dcloud.io/api/media/image?id=getimageinfo
613
+ * @autotest {
614
+ generated:false,
615
+ case:[
616
+ {
617
+ input:[{"src":"/static/a.jpg"}]
618
+ }
619
+ ]
620
+ }
621
+ */
622
+ getImageInfo(options : GetImageInfoOptions) : void;
623
+ /**
624
+ * 保存图片到系统相册
625
+ * @description 保存图片到系统相册
626
+ * @uniPlatform {
627
+ * "app": {
628
+ * "android": {
629
+ * "osVer": "4.4",
630
+ * "uniVer": "√",
631
+ * "unixVer": "3.9.0"
632
+ * }
633
+ * }
634
+ * }
635
+ * @uniVueVersion 2,3
636
+ * @example
637
+ * ```typescript
638
+ * uni.saveImageToPhotosAlbum({
639
+ * filePath:'/static/a.jpg',
640
+ * success(e){
641
+ * console.log(JSON.stringify(e))
642
+ * },
643
+ * })
644
+ * ```
645
+ * @tutorial http://uniapp.dcloud.io/api/media/image?id=saveimagetophotosalbum
646
+ * @autotest {
647
+ generated:false,
648
+ case:[
649
+ {
650
+ input:[{"filePath":"/static/a.jpg"}]
651
+ }
652
+ ]
653
+ }
654
+ */
655
+ saveImageToPhotosAlbum(options : SaveImageToPhotosAlbumOptions) : void;
656
+ /**
657
+ * 压缩图片
658
+ * @description 压缩图片
659
+ * @uniPlatform {
660
+ * "app": {
661
+ * "android": {
662
+ * "osVer": "4.4",
663
+ * "uniVer": "√",
664
+ * "unixVer": "3.9.0"
665
+ * }
666
+ * }
667
+ * }
668
+ * @uniVueVersion 2,3
669
+ * @example
670
+ * ```typescript
671
+ * uni.compressImage({
672
+ * src:'/static/a.jpg',
673
+ * quality:80,
674
+ * success(e){
675
+ * console.log(JSON.stringify(e))
676
+ * },
677
+ * })
678
+ * ```
679
+ * @tutorial http://uniapp.dcloud.io/api/media/image?id=compressimage
680
+ * @autotest {
681
+ generated:false,
682
+ case:[
683
+ {
684
+ input:[{"src":"/static/d.jpg"},{"rotate","30"}]
685
+ }
686
+ ]
687
+ }
688
+ */
689
+ compressImage(options : CompressImageOptions) : void;
690
+ /**
691
+ * 拍摄视频或从手机相册中选视频,返回视频的临时文件路径。
692
+ * @description 拍摄视频或从手机相册中选视频,返回视频的临时文件路径。
693
+ * @uniPlatform {
694
+ * "app": {
695
+ * "android": {
696
+ * "osVer": "4.4",
697
+ * "uniVer": "√",
698
+ * "unixVer": "3.9.0"
699
+ * }
700
+ * }
701
+ * }
702
+ * @uniVueVersion 2,3
703
+ * @example
704
+ * ```typescript
705
+ * uni.chooseVideo({
706
+ * success(e){
707
+ * console.log(JSON.stringify(e))
708
+ * },
709
+ * })
710
+ * ```
711
+ * @tutorial http://uniapp.dcloud.io/api/media/video?id=choosevideo
712
+ *
713
+ */
714
+ chooseVideo(options : ChooseVideoOptions) : void;
715
+ /**
716
+ * 获取视频详细信息
717
+ * @description 获取视频详细信息
718
+ * @uniPlatform {
719
+ * "app": {
720
+ * "android": {
721
+ * "osVer": "4.4",
722
+ * "uniVer": "√",
723
+ * "unixVer": "3.9.0"
724
+ * }
725
+ * }
726
+ * }
727
+ * @uniVueVersion 2,3
728
+ * @example
729
+ * ```typescript
730
+ * uni.GetVideoInfo({
731
+ * src:"/static/a.mp4",
732
+ * success(e){
733
+ * console.log(JSON.stringify(e))
734
+ * },
735
+ * })
736
+ * ```
737
+ * @tutorial http://uniapp.dcloud.io/api/media/video?id=getvideoinfo
738
+ *
739
+ */
740
+ getVideoInfo(options : GetVideoInfoOptions) : void;
741
+ /**
742
+ * 保存视频到系统相册
743
+ * @description 保存视频到系统相册
744
+ * @uniPlatform {
745
+ * "app": {
746
+ * "android": {
747
+ * "osVer": "4.4",
748
+ * "uniVer": "√",
749
+ * "unixVer": "3.9.0"
750
+ * }
751
+ * }
752
+ * }
753
+ * @uniVueVersion 2,3
754
+ * @example
755
+ * ```typescript
756
+ * uni.saveVideoToPhotosAlbum({
757
+ * filePath:"/static/a.mp4",
758
+ * success(e){
759
+ * console.log(JSON.stringify(e))
760
+ * },
761
+ * })
762
+ * ```
763
+ * @tutorial http://uniapp.dcloud.io/api/media/video?id=savevideotophotosalbum
764
+ *
765
+ */
766
+ saveVideoToPhotosAlbum(options : SaveVideoToPhotosAlbumOptions) : void;
767
+ /**
768
+ * 压缩视频
769
+ * @description 压缩视频
770
+ * @uniPlatform {
771
+ * "app": {
772
+ * "android": {
773
+ * "osVer": "4.4",
774
+ * "uniVer": "√",
775
+ * "unixVer": "3.9.0"
776
+ * }
777
+ * }
778
+ * }
779
+ * @uniVueVersion 2,3
780
+ * @example
781
+ * ```typescript
782
+ * uni.compressVideo({
783
+ * src:"/static/a.mp4",
784
+ * quality:"low",
785
+ * success(e){
786
+ * console.log(JSON.stringify(e))
787
+ * },
788
+ * })
789
+ * ```
790
+ * @tutorial http://uniapp.dcloud.io/api/media/video?id=compressvideo
791
+ *
792
+ */
793
+ compressVideo(options : CompressVideoOptions) : void;
794
+ }