@dcloudio/uni-app-x 0.4.6 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-app-x",
3
- "version": "0.4.6",
3
+ "version": "0.5.0",
4
4
  "description": "uni-app x types",
5
5
  "typings": "index.d.ts",
6
6
  "author": "DCloud",
package/types/app.d.ts CHANGED
@@ -206,7 +206,7 @@ interface AppInstance<T extends AnyObject = {}> {
206
206
  *
207
207
  * 应用初始化完成时触发,全局只触发一次。
208
208
  *
209
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
209
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
210
210
  * @uniPlatform {
211
211
  * "app": {
212
212
  * "android": {
@@ -283,7 +283,7 @@ interface AppInstance<T extends AnyObject = {}> {
283
283
  *
284
284
  * 应用启动,或从后台进入前台显示时触发
285
285
  *
286
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
286
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
287
287
  * @uniPlatform {
288
288
  * "app": {
289
289
  * "android": {
@@ -360,7 +360,7 @@ interface AppInstance<T extends AnyObject = {}> {
360
360
  *
361
361
  * 应用从前台进入后台时触发
362
362
  *
363
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
363
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
364
364
  * @uniPlatform {
365
365
  * "app": {
366
366
  * "android": {
@@ -437,7 +437,7 @@ interface AppInstance<T extends AnyObject = {}> {
437
437
  * 小程序发生脚本错误或 API 调用报错时触发
438
438
  * @param error 错误信息,包含堆栈
439
439
  *
440
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
440
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
441
441
  * @uniPlatform {
442
442
  * "app": {
443
443
  * "android": {
@@ -518,7 +518,7 @@ interface AppInstance<T extends AnyObject = {}> {
518
518
  * 1. 如果开发者没有添加 `onPageNotFound` 监听,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。
519
519
  * 2. 如果 `onPageNotFound` 回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再回调 `onPageNotFound`。
520
520
  *
521
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
521
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
522
522
  * @uniPlatform {
523
523
  * "app": {
524
524
  * "android": {
@@ -593,7 +593,7 @@ interface AppInstance<T extends AnyObject = {}> {
593
593
  /**
594
594
  * 未处理的 Promise 拒绝事件监听函数
595
595
  *
596
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
596
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
597
597
  * @uniPlatform {
598
598
  * "app": {
599
599
  * "android": {
@@ -668,7 +668,7 @@ interface AppInstance<T extends AnyObject = {}> {
668
668
  /**
669
669
  * 监听系统主题变化
670
670
  *
671
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
671
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
672
672
  * @uniPlatform {
673
673
  * "app": {
674
674
  * "android": {
@@ -745,7 +745,7 @@ interface AppInstance<T extends AnyObject = {}> {
745
745
  *
746
746
  * nvue 页面使用 `uni.postMessage` 发送消息时触发
747
747
  *
748
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
748
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
749
749
  * @uniPlatform {
750
750
  * "app": {
751
751
  * "android": {
@@ -820,7 +820,7 @@ interface AppInstance<T extends AnyObject = {}> {
820
820
  /**
821
821
  * 监听应用退出。app-uvue-android 3.9+
822
822
  *
823
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
823
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
824
824
  * @uniPlatform {
825
825
  * "app": {
826
826
  * "android": {
@@ -895,7 +895,7 @@ interface AppInstance<T extends AnyObject = {}> {
895
895
  /**
896
896
  * 最后一个页面按下Android back键,常用于自定义退出。app-uvue-android 3.9+
897
897
  *
898
- * 文档: [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
898
+ * @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
899
899
  * @uniPlatform {
900
900
  * "app": {
901
901
  * "android": {
@@ -2,7 +2,6 @@
2
2
 
3
3
  /**
4
4
  * @package io.dcloud.uniapp.runtime
5
- * @autodoc false
6
5
  */
7
6
  declare class CustomEventOptions<T>{
8
7
  detail: T
@@ -11,7 +10,6 @@ declare class CustomEventOptions<T>{
11
10
 
12
11
  /**
13
12
  * @package io.dcloud.uniapp.runtime
14
- * @autodoc false
15
13
  */
16
14
  declare class CustomEvent<T> extends Event {
17
15
  get detail(): T
@@ -1,5 +1,3 @@
1
- /// <reference path="./UTSError.d.ts" />
2
-
3
1
  /**
4
2
  * 源错误信息对象
5
3
  * @package io.dcloud.uniapp
@@ -13,7 +13,7 @@ declare class Touch {
13
13
  */
14
14
  clientY : number
15
15
  /**
16
- * 当前`Touch`对象的唯一标识符
16
+ * 触摸点的标识符。这个值在这根手指所引发的所有事件中保持一致,直到手指抬起。
17
17
  */
18
18
  identifier : number
19
19
  /**
@@ -46,4 +46,8 @@ declare class TouchEvent extends Event {
46
46
  * 当前停留在屏幕中的触摸点信息的数组
47
47
  */
48
48
  touches : Touch[]
49
+ /**
50
+ * 当前变化的触摸点信息的数组
51
+ */
52
+ changedTouches : Touch[]
49
53
  }
@@ -1,4 +1,3 @@
1
- /// <reference path="./UTSError.d.ts" />
2
1
  /// <reference path="./AsyncApiResult.d.ts" />
3
2
 
4
3
  /**
@@ -29,8 +29,6 @@
29
29
  /// <reference path='./UniAggregateError.d.ts' />
30
30
  /// <reference path='./UniAppManager.d.ts' />
31
31
  /// <reference path='./UniError.d.ts' />
32
- /// <reference path='./UTSError.d.ts' />
33
- /// <reference path='./UTSPromise.d.ts' />
34
32
  /// <reference path='./WebViewErrorEvent.d.ts' />
35
33
  /// <reference path='./WebViewLoadedEvent.d.ts' />
36
34
  /// <reference path='./WebViewLoadingEvent.d.ts' />
package/types/page.d.ts CHANGED
@@ -264,7 +264,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
264
264
  * 页面初始化时触发。一个页面只会调用一次,可以在 onInit 的参数中获取打开当前页面路径中的参数。
265
265
  * @param query 打开当前页面路径中的参数
266
266
  *
267
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
267
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
268
268
  * @uniPlatform {
269
269
  * "app": {
270
270
  * "android": {
@@ -342,7 +342,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
342
342
  * 页面加载时触发。一个页面只会调用一次,可以在 onLoad 的参数中获取打开当前页面路径中的参数。
343
343
  * @param query 打开当前页面路径中的参数
344
344
  *
345
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
345
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
346
346
  * @uniPlatform {
347
347
  * "app": {
348
348
  * "android": {
@@ -419,7 +419,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
419
419
  *
420
420
  * 页面显示/切入前台时触发。
421
421
  *
422
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
422
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
423
423
  * @uniPlatform {
424
424
  * "app": {
425
425
  * "android": {
@@ -496,7 +496,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
496
496
  *
497
497
  * 页面初次渲染完成时触发。一个页面只会调用一次,代表页面已经准备妥当,可以和视图层进行交互。
498
498
  *
499
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
499
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
500
500
  * @uniPlatform {
501
501
  * "app": {
502
502
  * "android": {
@@ -573,7 +573,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
573
573
  *
574
574
  * 页面隐藏/切入后台时触发。 如 `navigateTo` 或底部 `tab` 切换到其他页面,应用切入后台等。
575
575
  *
576
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
576
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
577
577
  * @uniPlatform {
578
578
  * "app": {
579
579
  * "android": {
@@ -650,7 +650,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
650
650
  *
651
651
  * 页面卸载时触发。如 `redirectTo` 或 `navigateBack` 到其他页面时。
652
652
  *
653
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
653
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
654
654
  * @uniPlatform {
655
655
  * "app": {
656
656
  * "android": {
@@ -728,7 +728,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
728
728
  * - 可以通过 `uni.startPullDownRefresh` 触发下拉刷新,调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。
729
729
  * - 当处理完数据刷新后,`uni.stopPullDownRefresh` 可以停止当前页面的下拉刷新。
730
730
  *
731
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
731
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
732
732
  * @uniPlatform {
733
733
  * "app": {
734
734
  * "android": {
@@ -805,7 +805,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
805
805
  * - 可以在 `pages.json` 的页面配置中设置触发距离 `onReachBottomDistance` 。
806
806
  * - 在触发距离内滑动期间,本事件只会被触发一次。
807
807
  *
808
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
808
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
809
809
  * @uniPlatform {
810
810
  * "app": {
811
811
  * "android": {
@@ -884,7 +884,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
884
884
  * @param options 分享发起来源参数
885
885
  * @return 转发内容
886
886
  *
887
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
887
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
888
888
  * @uniPlatform {
889
889
  * "app": {
890
890
  * "android": {
@@ -961,7 +961,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
961
961
  *
962
962
  * 监听右上角菜单“分享到朋友圈”按钮的行为,并自定义发享内容。
963
963
  *
964
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
964
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
965
965
  * @uniPlatform {
966
966
  * "app": {
967
967
  * "android": {
@@ -1038,7 +1038,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1038
1038
  *
1039
1039
  * 监听用户点击右上角菜单“收藏”按钮的行为,并自定义收藏内容。
1040
1040
  *
1041
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1041
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1042
1042
  * @uniPlatform {
1043
1043
  * "app": {
1044
1044
  * "android": {
@@ -1116,7 +1116,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1116
1116
  * 监听用户滑动页面事件。
1117
1117
  * @param options 页面滚动参数
1118
1118
  *
1119
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1119
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1120
1120
  * @uniPlatform {
1121
1121
  * "app": {
1122
1122
  * "android": {
@@ -1192,7 +1192,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1192
1192
  * 页面尺寸改变时触发
1193
1193
  * @param options 页面滚动参数
1194
1194
  *
1195
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1195
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1196
1196
  * @uniPlatform {
1197
1197
  * "app": {
1198
1198
  * "android": {
@@ -1268,7 +1268,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1268
1268
  * 当前是 tab 页时,点击 tab 时触发
1269
1269
  * @param options tab 点击参数
1270
1270
  *
1271
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1271
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1272
1272
  * @uniPlatform {
1273
1273
  * "app": {
1274
1274
  * "android": {
@@ -1344,7 +1344,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1344
1344
  * 监听原生标题栏按钮点击事件
1345
1345
  * @param options tab 点击参数
1346
1346
  *
1347
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1347
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1348
1348
  * @uniPlatform {
1349
1349
  * "app": {
1350
1350
  * "android": {
@@ -1421,7 +1421,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1421
1421
  * @param options tab 点击参数
1422
1422
  * @return 返回 `true` 时阻止页面返回
1423
1423
  *
1424
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1424
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1425
1425
  * @uniPlatform {
1426
1426
  * "app": {
1427
1427
  * "android": {
@@ -1496,7 +1496,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1496
1496
  /**
1497
1497
  * 监听原生标题栏搜索输入框输入内容变化事件
1498
1498
  *
1499
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1499
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1500
1500
  * @uniPlatform {
1501
1501
  * "app": {
1502
1502
  * "android": {
@@ -1571,7 +1571,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1571
1571
  /**
1572
1572
  * 监听原生标题栏搜索输入框搜索事件,用户点击软键盘上的“搜索”按钮时触发。
1573
1573
  *
1574
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1574
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1575
1575
  * @uniPlatform {
1576
1576
  * "app": {
1577
1577
  * "android": {
@@ -1646,7 +1646,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1646
1646
  /**
1647
1647
  * 监听原生标题栏搜索输入框点击事件
1648
1648
  *
1649
- * 文档: [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1649
+ * @tutorial [https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
1650
1650
  * @uniPlatform {
1651
1651
  * "app": {
1652
1652
  * "android": {
@@ -7,3 +7,4 @@
7
7
  /// <reference path='./lib/ui/pull-down-refresh/index.d.ts' />
8
8
  /// <reference path='./lib/ui/set-navigation-bar-color/index.d.ts' />
9
9
  /// <reference path='./lib/ui/tab-bar/index.d.ts' />
10
+ /// <reference path='./lib/interface.d.ts' />
@@ -55,36 +55,16 @@ export type PerformanceEntry = {
55
55
  * @type string
56
56
  */
57
57
  navigationType: string | null
58
- /**
59
- * 渲染层代码注入完成时间。仅 firstRender 指标有效。
60
- * @type number
61
- */
62
- viewLayerReadyTime: number | null
63
- /**
64
- * 首次渲染参数从逻辑层发出的时间。仅 firstRender 指标有效。
65
- * @type number
66
- */
67
- initDataSendTime: number | null
68
58
  /**
69
59
  * 首次渲染参数在渲染层收到的时间。仅 firstRender 指标有效。
70
60
  * @type number
71
61
  */
72
62
  initDataRecvTime: number | null
73
- /**
74
- * 渲染层代码注入完成时间。仅 firstRender 指标有效。
75
- * @type number
76
- */
77
- viewLayerRenderStartTime: number | null
78
63
  /**
79
64
  * 渲染层执行渲染结束时间。仅 firstRender 指标有效。
80
65
  * @type number
81
66
  */
82
67
  viewLayerRenderEndTime: number | null
83
- /**
84
- * 资源路径。仅 resourceTiming 指标有效。
85
- * @type string
86
- */
87
- uri: string | null
88
68
  }
89
69
 
90
70
  export type PerformanceObserverOptions = {
@@ -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 : string, component : ComponentPublicInstance) => WebviewContext | null
4
+
5
+ export interface WebviewContext {
6
+ /**
7
+ * @description 网页后退
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 网页前进
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 网页重新加载
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 网页停止加载
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 原生和WebView通信(执行JS脚本)
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 创建webview上下文WebviewContext对象
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} webview上下文
96
+ */
97
+ createWebviewContext : CreateWebviewContext
98
+ }
@@ -1,12 +1,10 @@
1
1
  import {
2
2
  ReadFileSuccessResult as ReadFileSuccessResultOrigin,
3
- ReadFileFailResult as ReadFileFailResultOrigin,
4
3
  ReadFileSuccessCallback as ReadFileSuccessCallbackOrigin,
5
4
  ReadFileFailCallback as ReadFileFailCallbackOrigin,
6
5
  ReadFileCompleteCallback as ReadFileCompleteCallbackOrigin,
7
6
  ReadFileOptions as ReadFileOptionsOrigin,
8
7
  WriteFileSuccessResult as WriteFileSuccessResultOrigin,
9
- WriteFileFailResult as WriteFileFailResultOrigin,
10
8
  WriteFileSuccessCallback as WriteFileSuccessCallbackOrigin,
11
9
  WriteFileFailCallback as WriteFileFailCallbackOrigin,
12
10
  WriteFileCompleteCallback as WriteFileCompleteCallbackOrigin,
@@ -18,13 +16,11 @@ import {
18
16
 
19
17
  declare global {
20
18
  type ReadFileSuccessResult = ReadFileSuccessResultOrigin
21
- type ReadFileFailResult = ReadFileFailResultOrigin
22
19
  type ReadFileSuccessCallback = ReadFileSuccessCallbackOrigin
23
20
  type ReadFileFailCallback = ReadFileFailCallbackOrigin
24
21
  type ReadFileCompleteCallback = ReadFileCompleteCallbackOrigin
25
22
  type ReadFileOptions = ReadFileOptionsOrigin
26
23
  type WriteFileSuccessResult = WriteFileSuccessResultOrigin
27
- type WriteFileFailResult = WriteFileFailResultOrigin
28
24
  type WriteFileSuccessCallback = WriteFileSuccessCallbackOrigin
29
25
  type WriteFileFailCallback = WriteFileFailCallbackOrigin
30
26
  type WriteFileCompleteCallback = WriteFileCompleteCallbackOrigin
@@ -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
 
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  GetLocation as GetLocationOrigin,
3
3
  GetLocationSuccess as GetLocationSuccessOrigin,
4
- GetLocationFail as GetLocationFailOrigin,
5
4
  GetLocationOptions as GetLocationOptionsOrigin,
6
5
  Uni as UniOrigin
7
6
  } from './interface'
@@ -9,7 +8,6 @@ import {
9
8
  declare global {
10
9
  type GetLocation = GetLocationOrigin
11
10
  type GetLocationSuccess = GetLocationSuccessOrigin
12
- type GetLocationFail = GetLocationFailOrigin
13
11
  type GetLocationOptions = GetLocationOptionsOrigin
14
12
  interface Uni extends UniOrigin { }
15
13
  }
@@ -71,15 +71,7 @@ export type GetLocationSuccess = {
71
71
  address: any | null
72
72
  };
73
73
  type GetLocationSuccessCallback = (result: GetLocationSuccess) => void;
74
- export type GetLocationFail = UniError;
75
- type UniError = {
76
- errSubject: string,
77
- errCode: number,
78
- errMsg: string,
79
- data: object | null,
80
- cause: any | null
81
- };
82
- type GetLocationFailCallback = (result: GetLocationFail) => void;
74
+ type GetLocationFailCallback = (result: UniError) => void;
83
75
  type GetLocationComplete = any;
84
76
  type GetLocationCompleteCallback = (result: GetLocationComplete) => void;
85
77
  export type GetLocationOptions = {