@dcloudio/uni-app-x 0.4.4 → 0.4.6

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 (72) hide show
  1. package/.env +2 -1
  2. package/package.json +5 -3
  3. package/tsconfig.json +5 -0
  4. package/types/app.d.ts +986 -0
  5. package/types/common.d.ts +7 -0
  6. package/types/index.d.ts +3 -0
  7. package/types/native/AsyncApiResult.d.ts +1 -0
  8. package/types/native/CSSStyleDeclaration.d.ts +20 -0
  9. package/types/native/CustomEvent.d.ts +3 -0
  10. package/types/native/DOMRect.d.ts +56 -0
  11. package/types/native/DrawableContext.d.ts +102 -11
  12. package/types/native/Event.d.ts +25 -8
  13. package/types/native/IApp.d.ts +1 -0
  14. package/types/native/IDocument.d.ts +1 -0
  15. package/types/native/INode.d.ts +140 -5
  16. package/types/native/IPage.d.ts +1 -0
  17. package/types/native/IPageManager.d.ts +1 -0
  18. package/types/native/ITabsNode.d.ts +1 -0
  19. package/types/native/IWebViewNode.d.ts +28 -0
  20. package/types/native/ImageErrorEvent.d.ts +13 -0
  21. package/types/native/ImageLoadEvent.d.ts +17 -0
  22. package/types/native/MouseEvent.d.ts +44 -2
  23. package/types/native/NodeData.d.ts +1 -0
  24. package/types/native/PageEvent.d.ts +1 -0
  25. package/types/native/PageScrollEvent.d.ts +3 -0
  26. package/types/native/ResizeEvent.d.ts +26 -6
  27. package/types/native/RichTextItemClickEvent.d.ts +21 -0
  28. package/types/native/ScrollEvent.d.ts +27 -9
  29. package/types/native/SourceError.d.ts +38 -0
  30. package/types/native/TabTapEvent.d.ts +10 -2
  31. package/types/native/TouchEvent.d.ts +37 -10
  32. package/types/native/UTSError.d.ts +5 -2
  33. package/types/native/UTSPromise.d.ts +74 -0
  34. package/types/native/UniAggregateError.d.ts +17 -0
  35. package/types/native/UniAppManager.d.ts +1 -0
  36. package/types/native/UniError.d.ts +54 -5
  37. package/types/native/WebViewErrorEvent.d.ts +13 -0
  38. package/types/native/WebViewLoadedEvent.d.ts +8 -0
  39. package/types/native/WebViewLoadingEvent.d.ts +8 -0
  40. package/types/native/WebViewMessageEvent.d.ts +13 -0
  41. package/types/native/index.d.ts +15 -1
  42. package/types/page.d.ts +1729 -0
  43. package/types/shims-vue.d.ts +12 -0
  44. package/types/uni/core/lib/performance/index.d.ts +21 -0
  45. package/types/uni/core/lib/performance/interface.d.ts +152 -0
  46. package/types/uni/core/lib/ui/create-selector-query/index.d.ts +4 -0
  47. package/types/uni/ext/index.d.ts +0 -1
  48. package/types/uni/ext/lib/uni-audio/utssdk/index.d.ts +4 -0
  49. package/types/uni/ext/lib/uni-exit/utssdk/interface.d.ts +4 -4
  50. package/types/uni/ext/lib/uni-file-manager/utssdk/index.d.ts +2 -0
  51. package/types/uni/ext/lib/uni-file-manager/utssdk/interface.d.ts +6 -6
  52. package/types/uni/ext/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +1 -1
  53. package/types/uni/ext/lib/uni-getDeviceInfo/utssdk/interface.d.ts +1 -1
  54. package/types/uni/ext/lib/uni-getLocation-system/utssdk/interface.d.ts +39 -17
  55. package/types/uni/ext/lib/uni-getNetworkType/utssdk/interface.d.ts +3 -10
  56. package/types/uni/ext/lib/uni-getRecorderManager/utssdk/index.d.ts +2 -0
  57. package/types/uni/ext/lib/uni-getSystemInfo/utssdk/interface.d.ts +3 -10
  58. package/types/uni/ext/lib/uni-media/utssdk/interface.d.ts +55 -55
  59. package/types/uni/ext/lib/uni-network/utssdk/app-ios/index.d.ts +67 -0
  60. package/types/uni/ext/lib/uni-network/utssdk/app-ios/interface.d.ts +530 -0
  61. package/types/uni/ext/lib/uni-network/utssdk/index.d.ts +10 -4
  62. package/types/uni/ext/lib/uni-network/utssdk/interface.d.ts +37 -77
  63. package/types/uni/ext/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +3 -3
  64. package/types/uni/ext/lib/uni-prompt/utssdk/index.d.ts +0 -8
  65. package/types/uni/ext/lib/uni-prompt/utssdk/interface.d.ts +35 -112
  66. package/types/uni/ext/lib/uni-storage/utssdk/interface.d.ts +13 -13
  67. package/types/uni/ext/lib/uni-websocket/utssdk/index.d.ts +2 -0
  68. package/types/uni/ext/lib/uni-websocket/utssdk/interface.d.ts +11 -18
  69. package/types/uni-cloud/index.d.ts +333 -274
  70. package/types/vue/index.d.ts +1 -1
  71. package/types/uni/ext/lib/uni-getLocation-tencent/utssdk/index.d.ts +0 -15
  72. package/types/uni/ext/lib/uni-getLocation-tencent/utssdk/interface.d.ts +0 -93
@@ -58,36 +58,36 @@ export type ChooseImageOptions = {
58
58
  /**
59
59
  * 最多可以选择的图片张数,默认9
60
60
  */
61
- count: (number) | null,
61
+ count?: (number) | null,
62
62
  /**
63
63
  * original 原图,compressed 压缩图,默认二者都有
64
64
  * @type string | string []
65
65
  */
66
- sizeType: (string[]) | null,
66
+ sizeType?: (string[]) | null,
67
67
  /**
68
68
  * album 从相册选图,camera 使用相机,默认二者都有
69
69
  */
70
- sourceType: (string[]) | null,
70
+ sourceType?: (string[]) | null,
71
71
  /**
72
72
  * 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。
73
73
  */
74
- extension: (string[]) | null,
74
+ extension?: (string[]) | null,
75
75
  /**
76
76
  * 图像裁剪参数,设置后 sizeType 失效。
77
77
  */
78
- crop: (ChooseImageCropOptions) | null,
78
+ crop?: (ChooseImageCropOptions) | null,
79
79
  /**
80
80
  * 成功则返回图片的本地文件路径列表 tempFilePaths
81
81
  */
82
- success: ((callback: ChooseImageSuccessCallback) => void) | null,
82
+ success?: ((callback: ChooseImageSuccessCallback) => void) | null,
83
83
  /**
84
84
  * 接口调用失败的回调函数
85
85
  */
86
- fail: ((callback: ChooseImageFailCallback) => void) | null,
86
+ fail?: ((callback: ChooseImageFailCallback) => void) | null,
87
87
  /**
88
88
  * 接口调用结束的回调函数(调用成功、失败都会执行)
89
89
  */
90
- complete: ((callback: any) => void) | null
90
+ complete?: ((callback: any) => void) | null
91
91
  }
92
92
 
93
93
  export type ChooseImage = (options: ChooseImageOptions) => void
@@ -154,12 +154,12 @@ export type PreviewImageOptions = {
154
154
  /**
155
155
  * 当前显示图片的链接,不填则默认为 urls 的第一张
156
156
  */
157
- count: string | null,
157
+ count?: string | null,
158
158
  /**
159
159
  * current 为当前显示图片的链接/索引值,不填或填写的值无效则为 urls 的第一张。App平台在 1.9.5至1.9.8之间,current为必填。不填会报错
160
160
  * @type string | number
161
161
  */
162
- current: any | null,
162
+ current?: any | null,
163
163
  /**
164
164
  * 需要预览的图片链接列表
165
165
  */
@@ -171,28 +171,28 @@ export type PreviewImageOptions = {
171
171
  * - none: 不显示指示器
172
172
  * @type 'default' | 'number' | 'none'
173
173
  */
174
- indicator: string | null,
174
+ indicator?: string | null,
175
175
  /**
176
176
  * 是否可循环预览
177
177
  * @type boolean
178
178
  */
179
- loop: boolean | null,
179
+ loop?: boolean | null,
180
180
  /**
181
181
  * 长按图片显示操作菜单,如不填默认为保存相册,1.9.5 起支持。
182
182
  */
183
- longPressActions: LongPressActionsOptions | null,
183
+ longPressActions?: LongPressActionsOptions | null,
184
184
  /**
185
185
  * 接口调用成功的回调函数
186
186
  */
187
- success: ((result: PreviewImageSuccessCallback) => void) | null,
187
+ success?: ((result: PreviewImageSuccessCallback) => void) | null,
188
188
  /**
189
189
  * 接口调用失败的回调函数
190
190
  */
191
- fail: ((result: PreviewImageFailCallback) => void) | null,
191
+ fail?: ((result: PreviewImageFailCallback) => void) | null,
192
192
  /**
193
193
  * 接口调用结束的回调函数(调用成功、失败都会执行)
194
194
  */
195
- complete: ((result: any) => void) | null
195
+ complete?: ((result: any) => void) | null
196
196
  };
197
197
 
198
198
  export type PreviewImage = (options: PreviewImageOptions) => void;
@@ -227,15 +227,15 @@ export type ClosePreviewImageOptions = {
227
227
  /**
228
228
  * 接口调用成功的回调函数
229
229
  */
230
- success: ((result: ClosePreviewImageSuccessCallback) => void) | null,
230
+ success?: ((result: ClosePreviewImageSuccessCallback) => void) | null,
231
231
  /**
232
232
  * 接口调用失败的回调函数
233
233
  */
234
- fail: ((result: ClosePreviewImageFailCallback) => void) | null,
234
+ fail?: ((result: ClosePreviewImageFailCallback) => void) | null,
235
235
  /**
236
236
  * 接口调用结束的回调函数(调用成功、失败都会执行)
237
237
  */
238
- complete: ((result: any) => void) | null
238
+ complete?: ((result: any) => void) | null
239
239
  };
240
240
 
241
241
  export type GetImageInfo = (options: GetImageInfoOptions) => void;
@@ -287,15 +287,15 @@ export type GetImageInfoOptions = {
287
287
  /**
288
288
  * 接口调用成功的回调函数
289
289
  */
290
- success: ((result: GetImageInfoSuccessCallback) => void) | null,
290
+ success?: ((result: GetImageInfoSuccessCallback) => void) | null,
291
291
  /**
292
292
  * 接口调用失败的回调函数
293
293
  */
294
- fail: ((result: GetImageInfoFailCallback) => void) | null,
294
+ fail?: ((result: GetImageInfoFailCallback) => void) | null,
295
295
  /**
296
296
  * 接口调用结束的回调函数(调用成功、失败都会执行)
297
297
  */
298
- complete: ((result: any) => void) | null
298
+ complete?: ((result: any) => void) | null
299
299
  };
300
300
 
301
301
  export type SaveImageToPhotosAlbum = (options: SaveImageToPhotosAlbumOptions) => void;
@@ -316,15 +316,15 @@ export type SaveImageToPhotosAlbumOptions = {
316
316
  /**
317
317
  * 接口调用成功的回调函数
318
318
  */
319
- success: ((result: SaveImageToPhotosAlbumSuccessCallback) => void) | null,
319
+ success?: ((result: SaveImageToPhotosAlbumSuccessCallback) => void) | null,
320
320
  /**
321
321
  * 接口调用失败的回调函数
322
322
  */
323
- fail: ((result: SaveImageToPhotosAlbumFailCallback) => void) | null,
323
+ fail?: ((result: SaveImageToPhotosAlbumFailCallback) => void) | null,
324
324
  /**
325
325
  * 接口调用结束的回调函数(调用成功、失败都会执行)
326
326
  */
327
- complete: ((result: any) => void) | null
327
+ complete?: ((result: any) => void) | null
328
328
  };
329
329
  export type CompressImage = (options: CompressImageOptions) => void;
330
330
  export type CompressImageSuccessCallback = {
@@ -342,39 +342,39 @@ export type CompressImageOptions = {
342
342
  /**
343
343
  * 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效)
344
344
  */
345
- quality: number | null,
345
+ quality?: number | null,
346
346
  /**
347
347
  * 旋转度数,范围0~360
348
348
  */
349
- rotate: number | null,
349
+ rotate?: number | null,
350
350
  /**
351
351
  * 缩放图片的宽度
352
352
  */
353
- width: string | null,
353
+ width?: string | null,
354
354
  /**
355
355
  * 缩放图片的高度
356
356
  */
357
- height: string | null,
357
+ height?: string | null,
358
358
  /**
359
359
  * 压缩后图片的高度,单位为px,若不填写则默认以compressedWidth为准等比缩放
360
360
  */
361
- compressedHeight: number | null,
361
+ compressedHeight?: number | null,
362
362
  /**
363
363
  * 压缩后图片的宽度,单位为px,若不填写则默认以compressedHeight为准等比缩放。
364
364
  */
365
- compressedWidth: number | null,
365
+ compressedWidth?: number | null,
366
366
  /**
367
367
  * 接口调用成功的回调函数
368
368
  */
369
- success: ((result: CompressImageSuccessCallback) => void) | null,
369
+ success?: ((result: CompressImageSuccessCallback) => void) | null,
370
370
  /**
371
371
  * 接口调用失败的回调函数
372
372
  */
373
- fail: ((result: CompressImageFailCallback) => void) | null,
373
+ fail?: ((result: CompressImageFailCallback) => void) | null,
374
374
  /**
375
375
  * 接口调用结束的回调函数(调用成功、失败都会执行)
376
376
  */
377
- complete: ((result: any) => void) | null
377
+ complete?: ((result: any) => void) | null
378
378
  };
379
379
 
380
380
  export type ChooseVideoSuccessCallback = {
@@ -412,39 +412,39 @@ export type ChooseVideoOptions = {
412
412
  /**
413
413
  * album 从相册选视频,camera 使用相机拍摄,默认为:['album', 'camera']
414
414
  */
415
- sourceType: (string[]) | null,
415
+ sourceType?: (string[]) | null,
416
416
  /**
417
417
  * 是否压缩所选的视频源文件,默认值为true,需要压缩
418
418
  * @type boolean
419
419
  */
420
- compressed: boolean | null,
420
+ compressed?: boolean | null,
421
421
  /**
422
422
  * 拍摄视频最长拍摄时间,单位秒。最长支持 60 秒
423
423
  */
424
- maxDuration: number | null,
424
+ maxDuration?: number | null,
425
425
  /**
426
426
  * 摄像切换
427
427
  * - front: 前置摄像头
428
428
  * - back: 后置摄像头
429
429
  * @type 'front' | 'back'
430
430
  */
431
- camera: string | null,
431
+ camera?: string | null,
432
432
  /**
433
433
  * 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。
434
434
  */
435
- extension: (string[]) | null,
435
+ extension?: (string[]) | null,
436
436
  /**
437
437
  * 接口调用成功,返回视频文件的临时文件路径,详见返回参数说明
438
438
  */
439
- success: ((result: ChooseVideoSuccessCallback) => void) | null,
439
+ success?: ((result: ChooseVideoSuccessCallback) => void) | null,
440
440
  /**
441
441
  * 接口调用失败的回调函数
442
442
  */
443
- fail: ((result: ChooseVideoFailCallback) => void) | null,
443
+ fail?: ((result: ChooseVideoFailCallback) => void) | null,
444
444
  /**
445
445
  * 接口调用结束的回调函数(调用成功、失败都会执行)
446
446
  */
447
- complete: ((result: any) => void) | null
447
+ complete?: ((result: any) => void) | null
448
448
  };
449
449
 
450
450
  export type ChooseVideo = (options: ChooseVideoOptions) => void;
@@ -494,15 +494,15 @@ export type GetVideoInfoOptions = {
494
494
  /**
495
495
  * 接口调用成功的回调函数
496
496
  */
497
- success: ((result: GetVideoInfoSuccessCallback) => void) | null,
497
+ success?: ((result: GetVideoInfoSuccessCallback) => void) | null,
498
498
  /**
499
499
  * 接口调用失败的回调函数
500
500
  */
501
- fail: ((result: GetVideoInfoFailCallback) => void) | null,
501
+ fail?: ((result: GetVideoInfoFailCallback) => void) | null,
502
502
  /**
503
503
  * 接口调用结束的回调函数(调用成功、失败都会执行)
504
504
  */
505
- complete: ((result: any) => void) | null
505
+ complete?: ((result: any) => void) | null
506
506
  };
507
507
 
508
508
  export type GetVideoInfo = (options: GetVideoInfoOptions) => void;
@@ -519,15 +519,15 @@ export type SaveVideoToPhotosAlbumOptions = {
519
519
  /**
520
520
  * 接口调用成功的回调函数
521
521
  */
522
- success: ((result: SaveVideoToPhotosAlbumSuccessCallback) => void) | null,
522
+ success?: ((result: SaveVideoToPhotosAlbumSuccessCallback) => void) | null,
523
523
  /**
524
524
  * 接口调用失败的回调函数
525
525
  */
526
- fail: ((result: SaveVideoToPhotosAlbumFailCallback) => void) | null,
526
+ fail?: ((result: SaveVideoToPhotosAlbumFailCallback) => void) | null,
527
527
  /**
528
528
  * 接口调用结束的回调函数(调用成功、失败都会执行)
529
529
  */
530
- complete: ((result: any) => void) | null
530
+ complete?: ((result: any) => void) | null
531
531
  };
532
532
 
533
533
  export type SaveVideoToPhotosAlbum = (options: SaveVideoToPhotosAlbumOptions) => void;
@@ -557,31 +557,31 @@ export type CompressVideoOptions = {
557
557
  * - high: 高
558
558
  * @type 'low' | 'medium' | 'high'
559
559
  */
560
- quality: string | null,
560
+ quality?: string | null,
561
561
  /**
562
562
  * 码率,单位 kbps
563
563
  */
564
- bitrate: number | null,
564
+ bitrate?: number | null,
565
565
  /**
566
566
  * 帧率
567
567
  */
568
- fps: number | null,
568
+ fps?: number | null,
569
569
  /**
570
570
  * 相对于原视频的分辨率比例,取值范围(0, 1]
571
571
  */
572
- resolution: number | null,
572
+ resolution?: number | null,
573
573
  /**
574
574
  * 接口调用成功的回调函数
575
575
  */
576
- success: ((result: CompressVideoSuccessCallback) => void) | null,
576
+ success?: ((result: CompressVideoSuccessCallback) => void) | null,
577
577
  /**
578
578
  * 接口调用失败的回调函数
579
579
  */
580
- fail: ((result: CompressVideoFailCallback) => void) | null,
580
+ fail?: ((result: CompressVideoFailCallback) => void) | null,
581
581
  /**
582
582
  * 接口调用结束的回调函数(调用成功、失败都会执行)
583
583
  */
584
- complete: ((result: any) => void) | null
584
+ complete?: ((result: any) => void) | null
585
585
  };
586
586
 
587
587
  export type CompressVideo = (options: CompressVideoOptions) => void;
@@ -0,0 +1,67 @@
1
+ import {
2
+ Request as RequestOrigin,
3
+ RequestOptions as RequestOptionsOrigin,
4
+ RequestSuccess as RequestSuccessOrigin,
5
+ RequestFail as RequestFailOrigin,
6
+ RequestSuccessCallback as RequestSuccessCallbackOrigin,
7
+ RequestFailCallback as RequestFailCallbackOrigin,
8
+ RequestCompleteCallback as RequestCompleteCallbackOrigin,
9
+ RequestTask as RequestTaskOrigin,
10
+ UploadFile as UploadFileOrigin,
11
+ UploadFileOptionFiles as UploadFileOptionFilesOrigin,
12
+ UploadFileSuccess as UploadFileSuccessOrigin,
13
+ UploadFileSuccessCallback as UploadFileSuccessCallbackOrigin,
14
+ UploadFileFail as UploadFileFailOrigin,
15
+ UploadFileFailCallback as UploadFileFailCallbackOrigin,
16
+ UploadFileCompleteCallback as UploadFileCompleteCallbackOrigin,
17
+ UploadFileOptions as UploadFileOptionsOrigin,
18
+ OnProgressUpdateResult as OnProgressUpdateResultOrigin,
19
+ UploadFileProgressUpdateCallback as UploadFileProgressUpdateCallbackOrigin,
20
+ UploadTask as UploadTaskOrigin,
21
+ DownloadFile as DownloadFileOrigin,
22
+ DownloadFileSuccess as DownloadFileSuccessOrigin,
23
+ DownloadFileSuccessCallback as DownloadFileSuccessCallbackOrigin,
24
+ DownloadFileFail as DownloadFileFailOrigin,
25
+ DownloadFileFailCallback as DownloadFileFailCallbackOrigin,
26
+ DownloadFileComplete as DownloadFileCompleteOrigin,
27
+ DownloadFileCompleteCallback as DownloadFileCompleteCallbackOrigin,
28
+ DownloadFileOptions as DownloadFileOptionsOrigin,
29
+ OnProgressDownloadResult as OnProgressDownloadResultOrigin,
30
+ DownloadFileProgressUpdateCallback as DownloadFileProgressUpdateCallbackOrigin,
31
+ DownloadTask as DownloadTaskOrigin,
32
+ Uni as UniOrigin
33
+ } from './interface'
34
+
35
+ declare global {
36
+ type Request = RequestOrigin
37
+ type RequestOptions = RequestOptionsOrigin
38
+ type RequestSuccess = RequestSuccessOrigin
39
+ type RequestFail = RequestFailOrigin
40
+ type RequestSuccessCallback = RequestSuccessCallbackOrigin
41
+ type RequestFailCallback = RequestFailCallbackOrigin
42
+ type RequestCompleteCallback = RequestCompleteCallbackOrigin
43
+ type RequestTask = RequestTaskOrigin
44
+ type UploadFile = UploadFileOrigin
45
+ type UploadFileOptionFiles = UploadFileOptionFilesOrigin
46
+ type UploadFileSuccess = UploadFileSuccessOrigin
47
+ type UploadFileSuccessCallback = UploadFileSuccessCallbackOrigin
48
+ type UploadFileFail = UploadFileFailOrigin
49
+ type UploadFileFailCallback = UploadFileFailCallbackOrigin
50
+ type UploadFileCompleteCallback = UploadFileCompleteCallbackOrigin
51
+ type UploadFileOptions = UploadFileOptionsOrigin
52
+ type OnProgressUpdateResult = OnProgressUpdateResultOrigin
53
+ type UploadFileProgressUpdateCallback = UploadFileProgressUpdateCallbackOrigin
54
+ type UploadTask = UploadTaskOrigin
55
+ type DownloadFile = DownloadFileOrigin
56
+ type DownloadFileSuccess = DownloadFileSuccessOrigin
57
+ type DownloadFileSuccessCallback = DownloadFileSuccessCallbackOrigin
58
+ type DownloadFileFail = DownloadFileFailOrigin
59
+ type DownloadFileFailCallback = DownloadFileFailCallbackOrigin
60
+ type DownloadFileComplete = DownloadFileCompleteOrigin
61
+ type DownloadFileCompleteCallback = DownloadFileCompleteCallbackOrigin
62
+ type DownloadFileOptions = DownloadFileOptionsOrigin
63
+ type OnProgressDownloadResult = OnProgressDownloadResultOrigin
64
+ type DownloadFileProgressUpdateCallback = DownloadFileProgressUpdateCallbackOrigin
65
+ type DownloadTask = DownloadTaskOrigin
66
+ interface Uni extends UniOrigin { }
67
+ }