@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
@@ -1,12 +1,20 @@
1
1
  import { AsyncApiSuccessResult } from '../../interface'
2
2
 
3
- export type SetTabBarBadge = (options: SetTabBarBadgeOptions) => void
4
3
  export type SetTabBarBadgeSuccess = AsyncApiSuccessResult
5
4
  export type SetTabBarBadgeSuccessCallback = (
6
5
  result: SetTabBarBadgeSuccess
7
6
  ) => void
8
- export type SetTabBarBadgeFail = UniError
9
- export type SetTabBarBadgeFailCallback = (result: SetTabBarBadgeFail) => void
7
+ /**
8
+ * 错误码
9
+ * - 100: TabBar 不存在
10
+ * - 200: 参数错误
11
+ */
12
+ export type SetTabBarErrCode = 100 | 200
13
+ export abstract class SetTabBarError extends UniError {
14
+ abstract override errCode: SetTabBarErrCode
15
+ }
16
+ export type SetTabBarBadgeFail = SetTabBarError
17
+ export type SetTabBarBadgeFailCallback = (result: SetTabBarError) => void
10
18
  export type SetTabBarBadgeComplete = AsyncApiResult
11
19
  export type SetTabBarBadgeCompleteCallback = (
12
20
  result: SetTabBarBadgeComplete
@@ -34,12 +42,11 @@ export type SetTabBarBadgeOptions = {
34
42
  complete?: SetTabBarBadgeCompleteCallback
35
43
  }
36
44
 
37
- export type RemoveTabBarBadge = (options: RemoveTabBarBadgeOptions) => void
38
45
  export type RemoveTabBarBadgeSuccess = AsyncApiSuccessResult
39
46
  export type RemoveTabBarBadgeSuccessCallback = (
40
47
  result: RemoveTabBarBadgeSuccess
41
48
  ) => void
42
- export type RemoveTabBarBadgeFail = UniError
49
+ export type RemoveTabBarBadgeFail = SetTabBarError
43
50
  export type RemoveTabBarBadgeFailCallback = (
44
51
  result: RemoveTabBarBadgeFail
45
52
  ) => void
@@ -66,12 +73,11 @@ export type RemoveTabBarBadgeOptions = {
66
73
  complete?: RemoveTabBarBadgeCompleteCallback
67
74
  }
68
75
 
69
- export type SetTabBarItem = (options: SetTabBarItemOptions) => void
70
76
  export type SetTabBarItemSuccess = AsyncApiSuccessResult
71
77
  export type SetTabBarItemSuccessCallback = (
72
78
  result: SetTabBarItemSuccess
73
79
  ) => void
74
- export type SetTabBarItemFail = UniError
80
+ export type SetTabBarItemFail = SetTabBarError
75
81
  export type SetTabBarItemFailCallback = (result: SetTabBarItemFail) => void
76
82
  export type SetTabBarItemComplete = AsyncApiResult
77
83
  export type SetTabBarItemCompleteCallback = (
@@ -196,12 +202,11 @@ export type MidButtonOptions = {
196
202
  iconfont?: MidButtonIconFont
197
203
  }
198
204
 
199
- export type SetTabBarStyle = (options: SetTabBarStyleOptions) => void
200
205
  export type SetTabBarStyleSuccess = AsyncApiSuccessResult
201
206
  export type SetTabBarStyleSuccessCallback = (
202
207
  result: SetTabBarStyleSuccess
203
208
  ) => void
204
- export type SetTabBarStyleFail = UniError
209
+ export type SetTabBarStyleFail = SetTabBarError
205
210
  export type SetTabBarStyleFailCallback = (result: SetTabBarStyleFail) => void
206
211
  export type SetTabBarStyleComplete = AsyncApiResult
207
212
  export type SetTabBarStyleCompleteCallback = (
@@ -258,10 +263,9 @@ export type SetTabBarStyleOptions = {
258
263
  complete?: SetTabBarStyleCompleteCallback
259
264
  }
260
265
 
261
- export type HideTabBar = (options?: HideTabBarOptions | null) => void
262
266
  export type HideTabBarSuccess = AsyncApiSuccessResult
263
267
  export type HideTabBarSuccessCallback = (result: HideTabBarSuccess) => void
264
- export type HideTabBarFail = UniError
268
+ export type HideTabBarFail = SetTabBarError
265
269
  export type HideTabBarFailCallback = (result: HideTabBarFail) => void
266
270
  export type HideTabBarComplete = AsyncApiResult
267
271
  export type HideTabBarCompleteCallback = (result: HideTabBarComplete) => void
@@ -284,10 +288,9 @@ export type HideTabBarOptions = {
284
288
  complete?: HideTabBarCompleteCallback
285
289
  }
286
290
 
287
- export type ShowTabBar = (options?: ShowTabBarOptions | null) => void
288
291
  export type ShowTabBarSuccess = AsyncApiSuccessResult
289
292
  export type ShowTabBarSuccessCallback = (result: ShowTabBarSuccess) => void
290
- export type ShowTabBarFail = UniError
293
+ export type ShowTabBarFail = SetTabBarError
291
294
  export type ShowTabBarFailCallback = (result: ShowTabBarFail) => void
292
295
  export type ShowTabBarComplete = AsyncApiResult
293
296
  export type ShowTabBarCompleteCallback = (result: ShowTabBarComplete) => void
@@ -310,12 +313,11 @@ export type ShowTabBarOptions = {
310
313
  complete?: ShowTabBarCompleteCallback
311
314
  }
312
315
 
313
- export type ShowTabBarRedDot = (options: ShowTabBarRedDotOptions) => void
314
316
  export type ShowTabBarRedDotSuccess = AsyncApiSuccessResult
315
317
  export type ShowTabBarRedDotSuccessCallback = (
316
318
  result: ShowTabBarRedDotSuccess
317
319
  ) => void
318
- export type ShowTabBarRedDotFail = UniError
320
+ export type ShowTabBarRedDotFail = SetTabBarError
319
321
  export type ShowTabBarRedDotFailCallback = (
320
322
  result: ShowTabBarRedDotFail
321
323
  ) => void
@@ -342,12 +344,11 @@ export type ShowTabBarRedDotOptions = {
342
344
  complete?: ShowTabBarRedDotCompleteCallback
343
345
  }
344
346
 
345
- export type HideTabBarRedDot = (options: HideTabBarRedDotOptions) => void
346
347
  export type HideTabBarRedDotSuccess = AsyncApiSuccessResult
347
348
  export type HideTabBarRedDotSuccessCallback = (
348
349
  result: HideTabBarRedDotSuccess
349
350
  ) => void
350
- export type HideTabBarRedDotFail = UniError
351
+ export type HideTabBarRedDotFail = SetTabBarError
351
352
  export type HideTabBarRedDotFailCallback = (
352
353
  result: HideTabBarRedDotFail
353
354
  ) => void
@@ -374,10 +375,6 @@ export type HideTabBarRedDotOptions = {
374
375
  complete?: HideTabBarRedDotCompleteCallback
375
376
  }
376
377
 
377
- export type OnTabBarMidButtonTap = (
378
- options: OnTabBarMidButtonTapCallback
379
- ) => void
380
-
381
378
  export type OnTabBarMidButtonTapCallback = () => void
382
379
 
383
380
  export interface Uni {
@@ -386,53 +383,53 @@ export interface Uni {
386
383
  *
387
384
  * @tutorial http://uniapp.dcloud.io/api/ui/tabbar?id=settabbarbadge
388
385
  */
389
- setTabBarBadge: SetTabBarBadge
386
+ setTabBarBadge(options: SetTabBarBadgeOptions): void
390
387
  /**
391
388
  * 移除 tabBar 某一项右上角的文本
392
389
  *
393
390
  * @tutorial http://uniapp.dcloud.io/api/ui/tabbar?id=removetabbarbadge
394
391
  */
395
- removeTabBarBadge: RemoveTabBarBadge
392
+ removeTabBarBadge(options: RemoveTabBarBadgeOptions): void
396
393
  /**
397
394
  * 动态设置 tabBar 某一项的内容
398
395
  *
399
396
  * @tutorial http://uniapp.dcloud.io/api/ui/tabbar?id=settabbaritem
400
397
  */
401
- setTabBarItem: SetTabBarItem
398
+ setTabBarItem(options: SetTabBarItemOptions): void
402
399
  /**
403
400
  * 动态设置 tabBar 的整体样式
404
401
  *
405
402
  * @tutorial http://uniapp.dcloud.io/api/ui/tabbar?id=settabbarstyle
406
403
  */
407
- setTabBarStyle: SetTabBarStyle
404
+ setTabBarStyle(options: SetTabBarStyleOptions): void
408
405
  /**
409
406
  * 隐藏 tabBar
410
407
  *
411
408
  * @tutorial http://uniapp.dcloud.io/api/ui/tabbar?id=hidetabbar
412
409
  */
413
- hideTabBar: HideTabBar
410
+ hideTabBar(options?: HideTabBarOptions | null): void
414
411
  /**
415
412
  * 显示 tabBar
416
413
  *
417
414
  * @tutorial http://uniapp.dcloud.io/api/ui/tabbar?id=showtabbar
418
415
  */
419
- showTabBar: ShowTabBar
416
+ showTabBar(options?: ShowTabBarOptions | null): void
420
417
  /**
421
418
  * 显示 tabBar 某一项的右上角的红点
422
419
  *
423
420
  * @tutorial http://uniapp.dcloud.io/api/ui/tabbar?id=showtabbarreddot
424
421
  */
425
- showTabBarRedDot: ShowTabBarRedDot
422
+ showTabBarRedDot(options: ShowTabBarRedDotOptions): void
426
423
  /**
427
424
  * 隐藏 tabBar 某一项的右上角的红点
428
425
  *
429
426
  * @tutorial http://uniapp.dcloud.io/api/ui/tabbar?id=hidetabbarreddot
430
427
  */
431
- hideTabBarRedDot: HideTabBarRedDot
432
- /**
433
- * 监听中间按钮的点击事件
434
- *
435
- * @tutorial http://uniapp.dcloud.io/api/ui/tabbar?id=ontabbarmidbuttontap
436
- */
437
- onTabBarMidButtonTap: OnTabBarMidButtonTap
428
+ hideTabBarRedDot(options: HideTabBarRedDotOptions): void
429
+ // /**
430
+ // * 监听中间按钮的点击事件
431
+ // *
432
+ // * @tutorial http://uniapp.dcloud.io/api/ui/tabbar?id=ontabbarmidbuttontap
433
+ // */
434
+ // onTabBarMidButtonTap(options: OnTabBarMidButtonTapCallback): void
438
435
  }
@@ -1,3 +1,4 @@
1
1
  /// <reference path='./base/index.d.ts' />
2
2
  /// <reference path='./core/index.d.ts' />
3
- /// <reference path='./ext/index.d.ts' />
3
+ /// <reference path='./uts-plugin-api/index.d.ts' />
4
+ /// <reference path='./uts-plugin-component/index.d.ts' />
@@ -1,18 +1,19 @@
1
- /// <reference path='./lib/uni-audio/utssdk/index.d.ts' />
2
- /// <reference path='./lib/uni-exit/utssdk/index.d.ts' />
3
- /// <reference path='./lib/uni-file-manager/utssdk/index.d.ts' />
4
- /// <reference path='./lib/uni-getAccessibilityInfo/utssdk/index.d.ts' />
5
- /// <reference path='./lib/uni-getAppAuthorizeSetting/utssdk/index.d.ts' />
6
- /// <reference path='./lib/uni-getAppBaseInfo/utssdk/index.d.ts' />
7
- /// <reference path='./lib/uni-getDeviceInfo/utssdk/index.d.ts' />
8
- /// <reference path='./lib/uni-getLocation-system/utssdk/index.d.ts' />
9
- /// <reference path='./lib/uni-getNetworkType/utssdk/index.d.ts' />
10
- /// <reference path='./lib/uni-getRecorderManager/utssdk/index.d.ts' />
11
- /// <reference path='./lib/uni-getSystemInfo/utssdk/index.d.ts' />
12
- /// <reference path='./lib/uni-getSystemSetting/utssdk/index.d.ts' />
13
- /// <reference path='./lib/uni-media/utssdk/index.d.ts' />
14
- /// <reference path='./lib/uni-network/utssdk/index.d.ts' />
15
- /// <reference path='./lib/uni-openAppAuthorizeSetting/utssdk/index.d.ts' />
16
- /// <reference path='./lib/uni-prompt/utssdk/index.d.ts' />
17
- /// <reference path='./lib/uni-storage/utssdk/index.d.ts' />
18
1
  /// <reference path='./lib/uni-websocket/utssdk/index.d.ts' />
2
+ /// <reference path='./lib/uni-storage/utssdk/index.d.ts' />
3
+ /// <reference path='./lib/uni-prompt/utssdk/index.d.ts' />
4
+ /// <reference path='./lib/uni-openAppAuthorizeSetting/utssdk/index.d.ts' />
5
+ /// <reference path='./lib/uni-network/utssdk/index.d.ts' />
6
+ /// <reference path='./lib/uni-media/utssdk/index.d.ts' />
7
+ /// <reference path='./lib/uni-getSystemSetting/utssdk/index.d.ts' />
8
+ /// <reference path='./lib/uni-getSystemInfo/utssdk/index.d.ts' />
9
+ /// <reference path='./lib/uni-getRecorderManager/utssdk/index.d.ts' />
10
+ /// <reference path='./lib/uni-getNetworkType/utssdk/index.d.ts' />
11
+ /// <reference path='./lib/uni-getLocation-system/utssdk/index.d.ts' />
12
+ /// <reference path='./lib/uni-getDeviceInfo/utssdk/index.d.ts' />
13
+ /// <reference path='./lib/uni-getAppBaseInfo/utssdk/index.d.ts' />
14
+ /// <reference path='./lib/uni-getAppAuthorizeSetting/utssdk/index.d.ts' />
15
+ /// <reference path='./lib/uni-getAccessibilityInfo/utssdk/index.d.ts' />
16
+ /// <reference path='./lib/uni-exit/utssdk/index.d.ts' />
17
+ /// <reference path='./lib/uni-createWebviewContext/utssdk/index.d.ts' />
18
+ /// <reference path='./lib/uni-audio/utssdk/index.d.ts' />
19
+ /// <reference path='./lib/uni-network/utssdk/app-ios/index.d.ts' />
@@ -782,7 +782,7 @@ export interface Uni {
782
782
  * @tutorial http://uniapp.dcloud.io/api/media/audio-context?id=createinneraudiocontext
783
783
  *
784
784
  */
785
- createInnerAudioContext: CreateInnerAudioContext
785
+ createInnerAudioContext() : InnerAudioContext;
786
786
  /**
787
787
  * 获取全局唯一的背景音频管理器 backgroundAudioManager
788
788
  * @description 获取全局唯一的背景音频管理器 backgroundAudioManager
@@ -800,5 +800,5 @@ export interface Uni {
800
800
  *
801
801
  * @tutorial http://uniapp.dcloud.io/api/media/background-audio-manager?id=getbackgroundaudiomanager
802
802
  */
803
- getBackgroundAudioManager: GetBackgroundAudioManager
803
+ getBackgroundAudioManager(): BackgroundAudioManager;
804
804
  }
@@ -0,0 +1,11 @@
1
+ import {
2
+ CreateWebviewContext as CreateWebviewContextOrigin,
3
+ WebviewContext as WebviewContextOrigin,
4
+ Uni as UniOrigin
5
+ } from './interface'
6
+
7
+ declare global {
8
+ type CreateWebviewContext = CreateWebviewContextOrigin
9
+ type WebviewContext = WebviewContextOrigin
10
+ interface Uni extends UniOrigin { }
11
+ }
@@ -0,0 +1,98 @@
1
+ import { ComponentPublicInstance } from 'vue'
2
+
3
+ export type CreateWebviewContext = (webviewId : WebviewIdString, component : ComponentPublicInstance | null) => WebviewContext | null
4
+
5
+ export interface WebviewContext {
6
+ /**
7
+ * @description 后退到 web-view 组件网页加载历史的上一页,如果不存在上一页则没有任何效果。
8
+ * @uniplatform {
9
+ * "app": {
10
+ * "android": {
11
+ * "osVer": "4.4",
12
+ * "uniVer": "x",
13
+ * "unixVer": "3.9.0"
14
+ * }
15
+ * }
16
+ * }
17
+ * @uniVueVersion 2,3
18
+ */
19
+ back() : void
20
+
21
+ /**
22
+ * @description 前进到 web-view 组件网页加载历史的下一页,如果不存在下一页则没有任何效果。
23
+ * @uniplatform {
24
+ * "app": {
25
+ * "android": {
26
+ * "osVer": "4.4",
27
+ * "uniVer": "x",
28
+ * "unixVer": "3.9.0"
29
+ * }
30
+ * }
31
+ * }
32
+ * @uniVueVersion 2,3
33
+ */
34
+ forward() : void
35
+
36
+ /**
37
+ * @description 重新加载 web-view 组件当前页面。
38
+ * @uniplatform {
39
+ * "app": {
40
+ * "android": {
41
+ * "osVer": "4.4",
42
+ * "uniVer": "x",
43
+ * "unixVer": "3.9.0"
44
+ * }
45
+ * }
46
+ * }
47
+ * @uniVueVersion 2,3
48
+ */
49
+ reload() : void
50
+
51
+ /**
52
+ * @description 停止加载 web-view 组件当前网页,该方法不能阻止已经加载的 html 文档,但是能够阻止未完成的图片及延迟加载的资源。
53
+ * @uniplatform {
54
+ * "app": {
55
+ * "android": {
56
+ * "osVer": "4.4",
57
+ * "uniVer": "x",
58
+ * "unixVer": "3.9.0"
59
+ * }
60
+ * }
61
+ * }
62
+ * @uniVueVersion 2,3
63
+ */
64
+ stop() : void
65
+
66
+ /**
67
+ * @description 在网页中执行指定的js脚本,在 uvue 页面中可通过此方法向 web-view 组件加载的页面发送数据
68
+ * @uniplatform {
69
+ * "app": {
70
+ * "android": {
71
+ * "osVer": "4.4",
72
+ * "uniVer": "x",
73
+ * "unixVer": "3.9.0"
74
+ * }
75
+ * }
76
+ * }
77
+ * @uniVueVersion 2,3
78
+ */
79
+ evalJS(js : string) : void
80
+ }
81
+
82
+ export interface Uni {
83
+ /**
84
+ * @description 创建 web-view 组件的上下文对象,用于操作 web-view 的行为。
85
+ * @uniplatform {
86
+ * "app": {
87
+ * "android": {
88
+ * "osVer": "4.4",
89
+ * "uniVer": "x",
90
+ * "unixVer": "3.9.0"
91
+ * }
92
+ * }
93
+ * }
94
+ * @uniVueVersion 2,3
95
+ * @return {CreateWebviewContext} web-view组件上下文对象
96
+ */
97
+ createWebviewContext(webviewId : string | HBuilderX.WebviewIdString, component : ComponentPublicInstance | null) : WebviewContext | null
98
+ }
@@ -57,7 +57,7 @@ export interface Uni {
57
57
  * }
58
58
  * @uniVueVersion 2,3 //支持的vue版本
59
59
  */
60
- exit: Exit;
60
+ exit(options?: ExitOptions | null):void;
61
61
  }
62
62
 
63
63
  export type Exit = (options?: ExitOptions | null) => void;
@@ -3,24 +3,10 @@ export type ReadFileSuccessResult = {
3
3
  data: string
4
4
  }
5
5
 
6
- export type ReadFileFailResult = {
7
- /**
8
- * 错误码
9
- */
10
- errCode: number,
11
- /**
12
- * 调用API的名称
13
- */
14
- errSubject: string,
15
- /**
16
- * 错误的详细信息
17
- */
18
- errMsg: string,
19
- }
20
6
 
21
7
  export type ReadFileSuccessCallback = (res: ReadFileSuccessResult) => void
22
8
 
23
- export type ReadFileFailCallback = (res: ReadFileFailResult) => void
9
+ export type ReadFileFailCallback = (res: UniError) => void
24
10
 
25
11
  export type ReadFileCompleteCallback = (res: any) => void
26
12
 
@@ -54,24 +40,10 @@ export type WriteFileSuccessResult = {
54
40
  filePath: string,
55
41
  }
56
42
 
57
- export type WriteFileFailResult = {
58
- /**
59
- * 错误码
60
- */
61
- errCode: number,
62
- /**
63
- * 调用API的名称
64
- */
65
- errSubject: string,
66
- /**
67
- * 错误的详细信息
68
- */
69
- errMsg: string,
70
- }
71
43
 
72
44
  export type WriteFileSuccessCallback = (res: WriteFileSuccessResult) => void
73
45
 
74
- export type WriteFileFailCallback = (res: WriteFileFailResult) => void
46
+ export type WriteFileFailCallback = (res: UniError) => void
75
47
 
76
48
  export type WriteFileCompleteCallback = (res: any) => void
77
49
 
@@ -109,7 +81,7 @@ export interface FileSystemManager {
109
81
  export type GetFileSystemManager = () => FileSystemManager;
110
82
 
111
83
 
112
- export interface Uni {
84
+ interface Uni {
113
85
  /**
114
86
  * 获取文件管理器
115
87
  * @uniPlatform {
@@ -128,5 +100,5 @@ export interface Uni {
128
100
  * }
129
101
  * @uniVueVersion 2,3 //支持的vue版本
130
102
  */
131
- getFileSystemManager: GetFileSystemManager
103
+ getFileSystemManager():FileSystemManager
132
104
  }
@@ -27,5 +27,5 @@ export interface Uni {
27
27
  uni.getAccessibilityInfo()
28
28
  ```
29
29
  */
30
- getAccessibilityInfo: GetAccessibilityInfo
30
+ getAccessibilityInfo(): UTSJSONObject;
31
31
  }
@@ -16,7 +16,7 @@ export interface Uni {
16
16
  * "ios": {
17
17
  * "osVer": "9.0",
18
18
  * "uniVer": "√",
19
- * "unixVer": "3.9.0"
19
+ * "unixVer": "x"
20
20
  * }
21
21
  * }
22
22
  * }
@@ -25,7 +25,7 @@ export interface Uni {
25
25
  uni.getAppAuthorizeSetting()
26
26
  ```
27
27
  */
28
- getAppAuthorizeSetting: GetAppAuthorizeSetting;
28
+ getAppAuthorizeSetting(): GetAppAuthorizeSettingResult;
29
29
  }
30
30
 
31
31
 
@@ -36,7 +36,21 @@ export type GetAppAuthorizeSettingResult = {
36
36
  * - authorized: 已经获得授权,无需再次请求授权
37
37
  * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
38
38
  * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
39
- * @type 'authorized' | 'denied' | 'not determined'
39
+ * @type 'authorized' | 'denied' | 'not determined'
40
+ * @uniPlatform {
41
+ * "app": {
42
+ * "android": {
43
+ * "osVer": "x",
44
+ * "uniVer": "x",
45
+ * "unixVer": "x"
46
+ * },
47
+ * "ios": {
48
+ * "osVer": "9.0",
49
+ * "uniVer": "√",
50
+ * "unixVer": "x"
51
+ * }
52
+ * }
53
+ * }
40
54
  */
41
55
  albumAuthorized: string | null,
42
56
  /**
@@ -45,7 +59,21 @@ export type GetAppAuthorizeSettingResult = {
45
59
  * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
46
60
  * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
47
61
  * - config error: Android平台没有该值;iOS平台:表示没有在 `manifest.json -> App模块配置` 中配置 `BlueTooth(低功耗蓝牙)` 模块
48
- * @type 'authorized' | 'denied' | 'not determined' | 'config error'
62
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
63
+ * @uniPlatform {
64
+ * "app": {
65
+ * "android": {
66
+ * "osVer": "x",
67
+ * "uniVer": "x",
68
+ * "unixVer": "x"
69
+ * },
70
+ * "ios": {
71
+ * "osVer": "9.0",
72
+ * "uniVer": "√",
73
+ * "unixVer": "x"
74
+ * }
75
+ * }
76
+ * }
49
77
  */
50
78
  bluetoothAuthorized: string | null,
51
79
  /**
@@ -67,7 +95,7 @@ export type GetAppAuthorizeSettingResult = {
67
95
  */
68
96
  locationAuthorized: string,
69
97
  /**
70
- * 定位准确度。true 表示模糊定位,false 表示精确定位(仅 iOS 支持)
98
+ * 定位准确度。true 表示模糊定位,false 表示精确定位
71
99
  * - reduced: 模糊定位
72
100
  * - full: 精准定位
73
101
  * - unsupported: 不支持(包括用户拒绝定位权限和没有在 `manifest.json -> App模块配置` 中配置 `Geolocation(定位)` 模块)
@@ -76,7 +104,21 @@ export type GetAppAuthorizeSettingResult = {
76
104
  locationAccuracy: string | null,
77
105
  /**
78
106
  * 定位准确度(推荐使用 locationAccuracy 属性)。true 表示模糊定位,false 表示精确定位(仅 iOS 支持)
79
- * @type boolean
107
+ * @type boolean
108
+ * @uniPlatform {
109
+ * "app": {
110
+ * "android": {
111
+ * "osVer": "x",
112
+ * "uniVer": "x",
113
+ * "unixVer": "x"
114
+ * },
115
+ * "ios": {
116
+ * "osVer": "9.0",
117
+ * "uniVer": "√",
118
+ * "unixVer": "x"
119
+ * }
120
+ * }
121
+ * }
80
122
  */
81
123
  locationReducedAccuracy: boolean | null,
82
124
  /**
@@ -103,7 +145,21 @@ export type GetAppAuthorizeSettingResult = {
103
145
  * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
104
146
  * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
105
147
  * - config error: 没有在 `manifest.json -> App模块配置` 中配置 `Push(推送)` 模块
106
- * @type 'authorized' | 'denied' | 'not determined' | 'config error'
148
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
149
+ * @uniPlatform {
150
+ * "app": {
151
+ * "android": {
152
+ * "osVer": "x",
153
+ * "uniVer": "x",
154
+ * "unixVer": "x"
155
+ * },
156
+ * "ios": {
157
+ * "osVer": "10.0",
158
+ * "uniVer": "√",
159
+ * "unixVer": "x"
160
+ * }
161
+ * }
162
+ * }
107
163
  */
108
164
  notificationAlertAuthorized: string | null,
109
165
  /**
@@ -112,7 +168,21 @@ export type GetAppAuthorizeSettingResult = {
112
168
  * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
113
169
  * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
114
170
  * - config error: 没有在 `manifest.json -> App模块配置` 中配置 `Push(推送)` 模块
115
- * @type 'authorized' | 'denied' | 'not determined' | 'config error'
171
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
172
+ * @uniPlatform {
173
+ * "app": {
174
+ * "android": {
175
+ * "osVer": "x",
176
+ * "uniVer": "x",
177
+ * "unixVer": "x"
178
+ * },
179
+ * "ios": {
180
+ * "osVer": "10.0",
181
+ * "uniVer": "√",
182
+ * "unixVer": "x"
183
+ * }
184
+ * }
185
+ * }
116
186
  */
117
187
  notificationBadgeAuthorized: string | null,
118
188
  /**
@@ -121,7 +191,21 @@ export type GetAppAuthorizeSettingResult = {
121
191
  * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
122
192
  * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
123
193
  * - config error: 没有在 `manifest.json -> App模块配置` 中配置 `Push(推送)` 模块
124
- * @type 'authorized' | 'denied' | 'not determined' | 'config error'
194
+ * @type 'authorized' | 'denied' | 'not determined' | 'config error'
195
+ * @uniPlatform {
196
+ * "app": {
197
+ * "android": {
198
+ * "osVer": "x",
199
+ * "uniVer": "x",
200
+ * "unixVer": "x"
201
+ * },
202
+ * "ios": {
203
+ * "osVer": "10.0",
204
+ * "uniVer": "√",
205
+ * "unixVer": "x"
206
+ * }
207
+ * }
208
+ * }
125
209
  */
126
210
  notificationSoundAuthorized: string | null,
127
211
  /**
@@ -129,7 +213,21 @@ export type GetAppAuthorizeSettingResult = {
129
213
  * - authorized: 已经获得授权,无需再次请求授权
130
214
  * - denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
131
215
  * - not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
132
- * @type 'authorized' | 'denied' | 'not determined'
216
+ * @type 'authorized' | 'denied' | 'not determined'
217
+ * @uniPlatform {
218
+ * "app": {
219
+ * "android": {
220
+ * "osVer": "x",
221
+ * "uniVer": "x",
222
+ * "unixVer": "x"
223
+ * },
224
+ * "ios": {
225
+ * "osVer": "x",
226
+ * "uniVer": "x",
227
+ * "unixVer": "x"
228
+ * }
229
+ * }
230
+ * }
133
231
  */
134
232
  phoneCalendarAuthorized: string | null
135
233
  };