@tarojs/taro 3.4.1 → 3.4.2

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 (88) hide show
  1. package/package.json +5 -5
  2. package/types/api/ai/face.d.ts +133 -0
  3. package/types/api/ai/visionkit.d.ts +303 -0
  4. package/types/api/base/crypto.d.ts +90 -0
  5. package/types/api/base/debug.d.ts +152 -13
  6. package/types/api/base/env.d.ts +2 -1
  7. package/types/api/base/index.d.ts +10 -2
  8. package/types/api/base/performance.d.ts +195 -0
  9. package/types/api/base/system.d.ts +539 -101
  10. package/types/api/base/update.d.ts +59 -7
  11. package/types/api/base/weapp/app-event.d.ts +46 -23
  12. package/types/api/base/weapp/life-cycle.d.ts +141 -1
  13. package/types/api/canvas/index.d.ts +150 -136
  14. package/types/api/cloud/index.d.ts +2 -2
  15. package/types/api/device/accelerometer.d.ts +3 -3
  16. package/types/api/device/accessibility.d.ts +26 -0
  17. package/types/api/device/battery.d.ts +2 -2
  18. package/types/api/device/{ble.d.ts → bluetooth-ble.d.ts} +228 -62
  19. package/types/api/device/bluetooth-peripheral.d.ts +430 -0
  20. package/types/api/device/bluetooth.d.ts +67 -2
  21. package/types/api/device/calendar.d.ts +88 -0
  22. package/types/api/device/contact.d.ts +74 -50
  23. package/types/api/device/gyroscope.d.ts +5 -5
  24. package/types/api/device/iBeacon.d.ts +33 -19
  25. package/types/api/{ui → device}/keyboard.d.ts +0 -0
  26. package/types/api/device/{performance.d.ts → memory.d.ts} +4 -4
  27. package/types/api/device/motion.d.ts +3 -3
  28. package/types/api/device/network.d.ts +53 -12
  29. package/types/api/device/nfc.d.ts +1089 -13
  30. package/types/api/device/scan.d.ts +1 -1
  31. package/types/api/device/screen.d.ts +40 -12
  32. package/types/api/device/wifi.d.ts +41 -6
  33. package/types/api/files/index.d.ts +371 -184
  34. package/types/api/location/index.d.ts +116 -55
  35. package/types/api/media/audio.d.ts +629 -38
  36. package/types/api/media/background-audio.d.ts +8 -8
  37. package/types/api/media/camera.d.ts +38 -19
  38. package/types/api/media/editor.d.ts +22 -2
  39. package/types/api/media/image.d.ts +61 -32
  40. package/types/api/media/live.d.ts +66 -6
  41. package/types/api/media/map.d.ts +469 -49
  42. package/types/api/media/media-recorder.d.ts +92 -0
  43. package/types/api/media/recorder.d.ts +20 -20
  44. package/types/api/media/video-decoder.d.ts +117 -0
  45. package/types/api/media/video-processing.d.ts +11 -7
  46. package/types/api/media/video.d.ts +45 -16
  47. package/types/api/media/voip.d.ts +290 -0
  48. package/types/api/{open-api/navigate.d.ts → navigate/index.d.ts} +63 -25
  49. package/types/api/network/download.d.ts +39 -16
  50. package/types/api/network/request.d.ts +125 -37
  51. package/types/api/network/tcp.d.ts +181 -0
  52. package/types/api/network/udp.d.ts +154 -83
  53. package/types/api/network/upload.d.ts +41 -25
  54. package/types/api/network/websocket.d.ts +16 -15
  55. package/types/api/open-api/authorize.d.ts +41 -2
  56. package/types/api/open-api/channels.d.ts +178 -0
  57. package/types/api/open-api/facial.d.ts +3 -0
  58. package/types/api/open-api/favorites.d.ts +100 -0
  59. package/types/api/open-api/group.d.ts +59 -0
  60. package/types/api/open-api/invoice.d.ts +2 -2
  61. package/types/api/open-api/license-plate.d.ts +27 -0
  62. package/types/api/open-api/login.d.ts +21 -0
  63. package/types/api/open-api/redpackage.d.ts +24 -0
  64. package/types/api/open-api/settings.d.ts +76 -14
  65. package/types/api/open-api/soter.d.ts +2 -2
  66. package/types/api/open-api/subscribe-message.d.ts +88 -3
  67. package/types/api/open-api/user-info.d.ts +55 -18
  68. package/types/api/open-api/werun.d.ts +33 -6
  69. package/types/api/payment/index.d.ts +119 -0
  70. package/types/api/route/index.d.ts +13 -9
  71. package/types/api/share/index.d.ts +192 -9
  72. package/types/api/storage/index.d.ts +29 -83
  73. package/types/api/swan/index.d.ts +1 -1
  74. package/types/api/ui/animation.d.ts +84 -70
  75. package/types/api/ui/background.d.ts +4 -2
  76. package/types/api/ui/custom-component.d.ts +1 -1
  77. package/types/api/ui/fonts.d.ts +27 -31
  78. package/types/api/ui/navigation-bar.d.ts +1 -0
  79. package/types/api/ui/scroll.d.ts +73 -7
  80. package/types/api/ui/sticky.d.ts +4 -4
  81. package/types/api/ui/tab-bar.d.ts +7 -7
  82. package/types/api/ui/window.d.ts +22 -2
  83. package/types/api/worker/index.d.ts +9 -1
  84. package/types/api/wxml/index.d.ts +111 -107
  85. package/types/compile.d.ts +5 -0
  86. package/types/global.d.ts +142 -111
  87. package/types/taro.api.d.ts +79 -62
  88. package/types/api/open-api/payment.d.ts +0 -61
@@ -18,10 +18,12 @@ declare module '../../index' {
18
18
  */
19
19
  interface IntersectionObserver {
20
20
  /** 停止监听。回调函数将不再触发
21
+ * @supported weapp
21
22
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.disconnect.html
22
23
  */
23
24
  disconnect(): void
24
25
  /** 指定目标节点并开始监听相交状态变化情况
26
+ * @supported weapp
25
27
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.observe.html
26
28
  */
27
29
  observe(
@@ -31,6 +33,7 @@ declare module '../../index' {
31
33
  callback: IntersectionObserver.ObserveCallback,
32
34
  ): void
33
35
  /** 使用选择器指定一个节点,作为参照区域之一。
36
+ * @supported weapp
34
37
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.relativeTo.html
35
38
  */
36
39
  relativeTo(
@@ -40,6 +43,7 @@ declare module '../../index' {
40
43
  margins?: IntersectionObserver.RelativeToMargins,
41
44
  ): IntersectionObserver
42
45
  /** 指定页面显示区域作为参照区域之一
46
+ * @supported weapp
43
47
  * @example
44
48
  * 下面的示例代码中,如果目标节点(用选择器 .target-class 指定)进入显示区域以下 100px 时,就会触发回调函数。
45
49
  *
@@ -175,109 +179,6 @@ declare module '../../index' {
175
179
  }) => void
176
180
  }
177
181
 
178
- /** 查询节点信息的对象
179
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html
180
- */
181
- interface SelectorQuery {
182
- /** 执行所有的请求。请求结果按请求次序构成数组,在callback的第一个参数中返回。
183
- * @supported weapp, h5
184
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.exec.html
185
- */
186
- exec(
187
- /** 回调函数 */
188
- callback?: (...args: any[]) => any,
189
- ): NodesRef
190
- /** 在当前页面下选择第一个匹配选择器 `selector` 的节点。返回一个 `NodesRef` 对象实例,可以用于获取节点信息。
191
- *
192
- * **selector 语法**
193
- *
194
- *
195
- * selector类似于 CSS 的选择器,但仅支持下列语法。
196
- *
197
- * - ID选择器:#the-id
198
- * - class选择器(可以连续指定多个):.a-class.another-class
199
- * - 子元素选择器:.the-parent > .the-child
200
- * - 后代选择器:.the-ancestor .the-descendant
201
- * - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant
202
- * - 多选择器的并集:#a-node, .some-other-nodes
203
- * @supported weapp, h5
204
- * @example
205
- * ```tsx
206
- * Taro.createSelectorQuery().select('#the-id').fields({
207
- * dataset: true,
208
- * size: true,
209
- * scrollOffset: true,
210
- * properties: ['scrollX', 'scrollY']
211
- * }, function (res){
212
- * res.dataset // 节点的dataset
213
- * res.width // 节点的宽度
214
- * res.height // 节点的高度
215
- * res.scrollLeft // 节点的水平滚动位置
216
- * res.scrollTop // 节点的竖直滚动位置
217
- * res.scrollX // 节点 scroll-x 属性的当前值
218
- * res.scrollY // 节点 scroll-x 属性的当前值
219
- * }).exec()
220
- * ```
221
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.select.html
222
- */
223
- select(
224
- /** 选择器 */
225
- selector: string,
226
- ): NodesRef
227
- /** 在当前页面下选择匹配选择器 selector 的所有节点。
228
- *
229
- * **selector 语法**
230
- *
231
- * selector类似于 CSS 的选择器,但仅支持下列语法。
232
- *
233
- * - ID选择器:#the-id
234
- * - class选择器(可以连续指定多个):.a-class.another-class
235
- * - 子元素选择器:.the-parent > .the-child
236
- * - 后代选择器:.the-ancestor .the-descendant
237
- * - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant
238
- * - 多选择器的并集:#a-node, .some-other-nodes
239
- * @supported weapp, h5
240
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.selectAll.html
241
- */
242
- selectAll(
243
- /** 选择器 */
244
- selector: string,
245
- ): NodesRef
246
- /** 选择显示区域。可用于获取显示区域的尺寸、滚动位置等信息。
247
- * @supported weapp, h5
248
- * @example
249
- * ```tsx
250
- * Taro.createSelectorQuery().selectViewport().scrollOffset(function (res) {
251
- * res.id // 节点的ID
252
- * res.dataset // 节点的dataset
253
- * res.scrollLeft // 节点的水平滚动位置
254
- * res.scrollTop // 节点的竖直滚动位置
255
- * }).exec()
256
- * ```
257
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.selectViewport.html
258
- */
259
- selectViewport(): NodesRef
260
- /** 将选择器的选取范围更改为自定义组件 `component` 内。(初始时,选择器仅选取页面范围的节点,不会选取任何自定义组件中的节点)。
261
- * @supported weapp, h5
262
- * @example
263
- * ```tsx
264
- * Component({
265
- * queryMultipleNodes () {
266
- * const query = Taro.createSelectorQuery().in(this)
267
- * query.select('#the-id').boundingClientRect(function(res){
268
- * res.top // 这个组件内 #the-id 节点的上边界坐标
269
- * }).exec()
270
- * }
271
- * })
272
- * ```
273
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.in.html
274
- */
275
- in(
276
- /** 自定义组件实例 */
277
- component: TaroGeneral.IAnyObject,
278
- ): SelectorQuery
279
- }
280
-
281
182
  /** 用于获取 `WXML` 节点信息的对象
282
183
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.html
283
184
  */
@@ -318,8 +219,8 @@ declare module '../../index' {
318
219
  /** 回调函数,在执行 `SelectorQuery.exec` 方法后,节点信息会在 `callback` 中返回。 */
319
220
  callback?: NodesRef.BoundingClientRectCallback,
320
221
  ): SelectorQuery
321
- /** 添加节点的 Context 对象查询请求。目前支持 [VideoContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.html)、[CanvasContext](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html)、[LivePlayerContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.html)、[EditorContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.html)和 [MapContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.html) 的获取。
322
- * @supported weapp
222
+ /** 添加节点的 Context 对象查询请求。目前支持 [VideoContext](/docs/apis/media/video/VideoContext)、[CanvasContext](/docs/apis/canvas/CanvasContext)、[LivePlayerContext](/docs/apis/media/live/LivePlayerContext)、[EditorContext](/docs/apis/media/editor/EditorContext)和 [MapContext](/docs/apis/media/map/MapContext) 的获取。
223
+ * @supported weapp, h5
323
224
  * @example
324
225
  * ```tsx
325
226
  * Taro.createSelectorQuery().select('.the-video-class').context(function (res) {
@@ -367,8 +268,8 @@ declare module '../../index' {
367
268
  /** 回调函数 */
368
269
  callback?: NodesRef.FieldsCallback,
369
270
  ): SelectorQuery
370
- /** 获取 Node 节点实例。目前支持 [Canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 的获取。
371
- * @supported weapp
271
+ /** 获取 Node 节点实例。目前支持 [Canvas](/docs/components/canvas/canvas) 的获取。
272
+ * @supported weapp, h5
372
273
  * @example
373
274
  * ```tsx
374
275
  * Taro.createSelectorQuery().select('.canvas').node(function(res){
@@ -478,6 +379,109 @@ declare module '../../index' {
478
379
  }
479
380
  }
480
381
 
382
+ /** 查询节点信息的对象
383
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html
384
+ */
385
+ interface SelectorQuery {
386
+ /** 执行所有的请求。请求结果按请求次序构成数组,在callback的第一个参数中返回。
387
+ * @supported weapp, h5
388
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.exec.html
389
+ */
390
+ exec(
391
+ /** 回调函数 */
392
+ callback?: (...args: any[]) => any,
393
+ ): NodesRef
394
+ /** 将选择器的选取范围更改为自定义组件 `component` 内。(初始时,选择器仅选取页面范围的节点,不会选取任何自定义组件中的节点)。
395
+ * @supported weapp, h5
396
+ * @example
397
+ * ```tsx
398
+ * Component({
399
+ * queryMultipleNodes () {
400
+ * const query = Taro.createSelectorQuery().in(this)
401
+ * query.select('#the-id').boundingClientRect(function(res){
402
+ * res.top // 这个组件内 #the-id 节点的上边界坐标
403
+ * }).exec()
404
+ * }
405
+ * })
406
+ * ```
407
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.in.html
408
+ */
409
+ in(
410
+ /** 自定义组件实例 */
411
+ component: TaroGeneral.IAnyObject,
412
+ ): SelectorQuery
413
+ /** 在当前页面下选择第一个匹配选择器 `selector` 的节点。返回一个 `NodesRef` 对象实例,可以用于获取节点信息。
414
+ *
415
+ * **selector 语法**
416
+ *
417
+ *
418
+ * selector类似于 CSS 的选择器,但仅支持下列语法。
419
+ *
420
+ * - ID选择器:#the-id
421
+ * - class选择器(可以连续指定多个):.a-class.another-class
422
+ * - 子元素选择器:.the-parent > .the-child
423
+ * - 后代选择器:.the-ancestor .the-descendant
424
+ * - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant
425
+ * - 多选择器的并集:#a-node, .some-other-nodes
426
+ * @supported weapp, h5
427
+ * @example
428
+ * ```tsx
429
+ * Taro.createSelectorQuery().select('#the-id').fields({
430
+ * dataset: true,
431
+ * size: true,
432
+ * scrollOffset: true,
433
+ * properties: ['scrollX', 'scrollY']
434
+ * }, function (res){
435
+ * res.dataset // 节点的dataset
436
+ * res.width // 节点的宽度
437
+ * res.height // 节点的高度
438
+ * res.scrollLeft // 节点的水平滚动位置
439
+ * res.scrollTop // 节点的竖直滚动位置
440
+ * res.scrollX // 节点 scroll-x 属性的当前值
441
+ * res.scrollY // 节点 scroll-x 属性的当前值
442
+ * }).exec()
443
+ * ```
444
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.select.html
445
+ */
446
+ select(
447
+ /** 选择器 */
448
+ selector: string,
449
+ ): NodesRef
450
+ /** 在当前页面下选择匹配选择器 selector 的所有节点。
451
+ *
452
+ * **selector 语法**
453
+ *
454
+ * selector类似于 CSS 的选择器,但仅支持下列语法。
455
+ *
456
+ * - ID选择器:#the-id
457
+ * - class选择器(可以连续指定多个):.a-class.another-class
458
+ * - 子元素选择器:.the-parent > .the-child
459
+ * - 后代选择器:.the-ancestor .the-descendant
460
+ * - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant
461
+ * - 多选择器的并集:#a-node, .some-other-nodes
462
+ * @supported weapp, h5
463
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.selectAll.html
464
+ */
465
+ selectAll(
466
+ /** 选择器 */
467
+ selector: string,
468
+ ): NodesRef
469
+ /** 选择显示区域。可用于获取显示区域的尺寸、滚动位置等信息。
470
+ * @supported weapp, h5
471
+ * @example
472
+ * ```tsx
473
+ * Taro.createSelectorQuery().selectViewport().scrollOffset(function (res) {
474
+ * res.id // 节点的ID
475
+ * res.dataset // 节点的dataset
476
+ * res.scrollLeft // 节点的水平滚动位置
477
+ * res.scrollTop // 节点的竖直滚动位置
478
+ * }).exec()
479
+ * ```
480
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.selectViewport.html
481
+ */
482
+ selectViewport(): NodesRef
483
+ }
484
+
481
485
  interface TaroStatic {
482
486
  /** 返回一个 SelectorQuery 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createSelectorQuery()` 来代替。
483
487
  * @supported weapp, h5
@@ -110,6 +110,11 @@ export interface ICompileOption {
110
110
  interface Runtime {
111
111
  enableInnerHTML: boolean
112
112
  enableSizeAPIs: boolean
113
+ enableAdjacentHTML: boolean
114
+ enableTemplateContent: boolean
115
+ enableCloneNode: boolean
116
+ enableContains: boolean
117
+ enableMutationObserver: boolean
113
118
  }
114
119
 
115
120
  export interface IMiniAppConfig {
package/types/global.d.ts CHANGED
@@ -99,55 +99,55 @@ declare namespace TaroGeneral {
99
99
  */
100
100
  interface AdErrCode {
101
101
  /**
102
- * @abnormal 后端接口调用失败
102
+ * @illustrate 后端接口调用失败
103
103
  * @reason 该项错误不是开发者的异常情况
104
104
  * @solution 一般情况下忽略一段时间即可恢复。
105
105
  */
106
106
  1000
107
107
  /**
108
- * @abnormal 参数错误
108
+ * @illustrate 参数错误
109
109
  * @reason 使用方法错误
110
110
  * @solution 可以前往 developers.weixin.qq.com 确认具体教程(小程序和小游戏分别有各自的教程,可以在顶部选项中,“设计”一栏的右侧进行切换。
111
111
  */
112
112
  1001
113
113
  /**
114
- * @abnormal 广告单元无效
114
+ * @illustrate 广告单元无效
115
115
  * @reason 可能是拼写错误、或者误用了其他APP的广告ID
116
116
  * @solution 请重新前往 mp.weixin.qq.com 确认广告位ID。
117
117
  */
118
118
  1002
119
119
  /**
120
- * @abnormal 内部错误
120
+ * @illustrate 内部错误
121
121
  * @reason 该项错误不是开发者的异常情况
122
122
  * @solution 一般情况下忽略一段时间即可恢复。
123
123
  */
124
124
  1003
125
125
  /**
126
- * @abnormal 无合适的广告
126
+ * @illustrate 无合适的广告
127
127
  * @reason 广告不是每一次都会出现,这次没有出现可能是由于该用户不适合浏览广告
128
128
  * @solution 属于正常情况,且开发者需要针对这种情况做形态上的兼容。
129
129
  */
130
130
  1004
131
131
  /**
132
- * @abnormal 广告组件审核中
132
+ * @illustrate 广告组件审核中
133
133
  * @reason 你的广告正在被审核,无法展现广告
134
134
  * @solution 请前往 mp.weixin.qq.com 确认审核状态,且开发者需要针对这种情况做形态上的兼容。
135
135
  */
136
136
  1005
137
137
  /**
138
- * @abnormal 广告组件被驳回
138
+ * @illustrate 广告组件被驳回
139
139
  * @reason 你的广告审核失败,无法展现广告
140
140
  * @solution 请前往 mp.weixin.qq.com 确认审核状态,且开发者需要针对这种情况做形态上的兼容。
141
141
  */
142
142
  1006
143
143
  /**
144
- * @abnormal 广告组件被封禁
144
+ * @illustrate 广告组件被封禁
145
145
  * @reason 你的广告能力已经被封禁,封禁期间无法展现广告
146
146
  * @solution 请前往 mp.weixin.qq.com 确认小程序广告封禁状态。
147
147
  */
148
148
  1007
149
149
  /**
150
- * @abnormal 广告单元已关闭
150
+ * @illustrate 广告单元已关闭
151
151
  * @reason 该广告位的广告能力已经被关闭
152
152
  * @solution 请前往 mp.weixin.qq.com 重新打开对应广告位的展现。
153
153
  */
@@ -156,196 +156,227 @@ declare namespace TaroGeneral {
156
156
  }
157
157
  /** 蓝牙错误码 */
158
158
  interface BluetoothErrCode {
159
- /** 正常
160
- * @abnormal ok
159
+ /** ok
160
+ * @illustrate 正常
161
161
  */
162
162
  0
163
- /** 未初始化蓝牙适配器
164
- * @abnormal not init
163
+ /** not init
164
+ * @illustrate 未初始化蓝牙适配器
165
165
  */
166
166
  10000
167
- /** 当前蓝牙适配器不可用
168
- * @abnormal not available
167
+ /** not available
168
+ * @illustrate 当前蓝牙适配器不可用
169
169
  */
170
170
  10001
171
- /** 没有找到指定设备
172
- * @abnormal no device
171
+ /** no device
172
+ * @illustrate 没有找到指定设备
173
173
  */
174
174
  10002
175
- /** 连接失败
176
- * @abnormal connection fail
175
+ /** connection fail
176
+ * @illustrate 连接失败
177
177
  */
178
178
  10003
179
- /** 没有找到指定服务
180
- * @abnormal no service
179
+ /** no service
180
+ * @illustrate 没有找到指定服务
181
181
  */
182
182
  10004
183
- /** 没有找到指定特征值
184
- * @abnormal no characteristic
183
+ /** no characteristic
184
+ * @illustrate 没有找到指定特征值
185
185
  */
186
186
  10005
187
- /** 当前连接已断开
188
- * @abnormal no connection
187
+ /** no connection
188
+ * @illustrate 当前连接已断开
189
189
  */
190
190
  10006
191
- /** 当前特征值不支持此操作
192
- * @abnormal property not support
191
+ /** property not support
192
+ * @illustrate 当前特征值不支持此操作
193
193
  */
194
194
  10007
195
- /** 其余所有系统上报的异常
196
- * @abnormal system error
195
+ /** system error
196
+ * @illustrate 其余所有系统上报的异常
197
197
  */
198
198
  10008
199
- /** Android 系统特有,系统版本低于 4.3 不支持 BLE
200
- * @abnormal system not support
199
+ /** system not support
200
+ * @illustrate Android 系统特有,系统版本低于 4.3 不支持 BLE
201
201
  */
202
202
  10009
203
- /** 连接超时
204
- * @abnormal operate time out
203
+ /** operate time out
204
+ * @illustrate 连接超时
205
205
  */
206
206
  10012
207
- /** 连接 deviceId 为空或者是格式不正确
208
- * @abnormal invalid_data
207
+ /** invalid_data
208
+ * @illustrate 连接 deviceId 为空或者是格式不正确
209
209
  */
210
210
  10013
211
211
  }
212
212
  /** iBeacon 错误码 */
213
213
  interface IBeaconErrCode {
214
- /** 正常
215
- * @abnormal ok
214
+ /** ok
215
+ * @illustrate 正常
216
216
  */
217
217
  0
218
- /** 系统或设备不支持
219
- * @abnormal unsupport
218
+ /** unsupport
219
+ * @illustrate 系统或设备不支持
220
220
  */
221
221
  11000
222
- /** 蓝牙服务不可用
223
- * @abnormal bluetooth service unavailable
222
+ /** bluetooth service unavailable
223
+ * @illustrate 蓝牙服务不可用
224
224
  */
225
225
  11001
226
- /** 位置服务不可用
227
- * @abnormal location service unavailable
226
+ /** location service unavailable
227
+ * @illustrate 位置服务不可用
228
228
  */
229
229
  11002
230
- /** 已经开始搜索
231
- * @abnormal already start
230
+ /** already start
231
+ * @illustrate 已经开始搜索
232
232
  */
233
233
  11003
234
- /** 还未开始搜索
235
- * @abnormal not startBeaconDiscovery
234
+ /** not startBeaconDiscovery
235
+ * @illustrate 还未开始搜索
236
236
  */
237
237
  11004
238
- /** 系统错误
239
- * @abnormal system error
238
+ /** system error
239
+ * @illustrate 系统错误
240
240
  */
241
241
  11005
242
- /** 参数不正确
243
- * @abnormal invalid data
242
+ /** invalid data
243
+ * @illustrate 参数不正确
244
244
  */
245
245
  11006
246
246
  }
247
247
  /** WIFI 错误码 */
248
248
  interface WifiErrCode {
249
- /** 正常
250
- * @abnormal ok
249
+ /** ok
250
+ * @illustrate 正常
251
251
  */
252
252
  0
253
- /** 未先调用 `startWifi` 接口
254
- * @abnormal not init
253
+ /** not init
254
+ * @illustrate 未先调用 `startWifi` 接口
255
255
  */
256
256
  12000
257
- /** 当前系统不支持相关能力
258
- * @abnormal system not support
257
+ /** system not support
258
+ * @illustrate 当前系统不支持相关能力
259
259
  */
260
260
  12001
261
- /** 密码错误
262
- * @abnormal password error Wi-Fi
261
+ /** password error Wi-Fi
262
+ * @illustrate 密码错误
263
263
  */
264
264
  12002
265
- /** 连接超时
266
- * @abnormal connection timeout
265
+ /** connection timeout
266
+ * @illustrate 连接超时
267
267
  */
268
268
  12003
269
- /** 重复连接 Wi-Fi
270
- * @abnormal duplicate request
269
+ /** duplicate request
270
+ * @illustrate 重复连接 Wi-Fi
271
271
  */
272
272
  12004
273
- /** Android 特有,未打开 Wi-Fi 开关
274
- * @abnormal wifi not turned on
273
+ /** wifi not turned on
274
+ * @illustrate Android 特有,未打开 Wi-Fi 开关
275
275
  */
276
276
  12005
277
- /** Android 特有,未打开 GPS 定位开关
278
- * @abnormal wifi not turned on
277
+ /** gps not turned on
278
+ * @illustrate Android 特有,未打开 GPS 定位开关
279
279
  */
280
280
  12006
281
- /** 用户拒绝授权链接 Wi-Fi
282
- * @abnormal user denied
281
+ /** user denied
282
+ * @illustrate 用户拒绝授权链接 Wi-Fi
283
283
  */
284
284
  12007
285
- /** 无效 SSID
286
- * @abnormal invalid SSID
285
+ /** invalid SSID
286
+ * @illustrate 无效 SSID
287
287
  */
288
288
  12008
289
- /** 系统运营商配置拒绝连接 Wi-Fi
290
- * @abnormal system config err
289
+ /** system config err
290
+ * @illustrate 系统运营商配置拒绝连接 Wi-Fi
291
291
  */
292
292
  12009
293
- /** 系统其他错误,需要在 errmsg 打印具体的错误原因
294
- * @abnormal system internal error
293
+ /** system internal error
294
+ * @illustrate 系统其他错误,需要在 errmsg 打印具体的错误原因
295
295
  */
296
296
  12010
297
- /** 应用在后台无法配置 Wi-Fi
298
- * @abnormal weapp in background
297
+ /** weapp in background
298
+ * @illustrate 应用在后台无法配置 Wi-Fi
299
299
  */
300
300
  12011
301
- /** 系统保存的 Wi-Fi 配置过期,建议忘记 Wi-Fi 后重试
302
- * @abnormal wifi config may be expired
301
+ /** wifi config may be expired
302
+ * @illustrate 系统保存的 Wi-Fi 配置过期,建议忘记 Wi-Fi 后重试
303
303
  */
304
304
  12013
305
305
  }
306
306
  /** NFC 错误码 */
307
307
  interface NFCErrCode {
308
- /** 正常
309
- * @abnormal ok
308
+ /** ok
309
+ * @illustrate 正常
310
310
  */
311
311
  0
312
- /** 当前设备不支持NFC */
312
+ /** @illustrate 当前设备不支持 NFC */
313
313
  13000
314
- /** 当前设备支持NFC,但系统NFC开关未开启 */
314
+ /** @illustrate 当前设备支持 NFC,但系统 NFC 开关未开启 */
315
315
  13001
316
- /** 当前设备支持NFC,但不支持HCE */
316
+ /** @illustrate 当前设备支持 NFC,但不支持 HCE */
317
317
  13002
318
- /** AID列表参数格式错误 */
318
+ /** @illustrate AID 列表参数格式错误 */
319
319
  13003
320
- /** 未设置微信为默认NFC支付应用 */
320
+ /** @illustrate 未设置微信为默认 NFC 支付应用 */
321
321
  13004
322
- /** 返回的指令不合法 */
322
+ /** @illustrate 返回的指令不合法 */
323
323
  13005
324
- /** 注册AID失败 */
324
+ /** @illustrate 注册 AID 失败 */
325
325
  13006
326
- }
327
-
328
- /** 启动参数 */
329
- interface LaunchOptionsApp {
330
- /** 启动小程序的路径 */
331
- path: string
332
- /** 启动小程序的 query 参数 */
333
- query: IAnyObject
334
- /** 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) */
335
- referrerInfo: LaunchOptionsApp.ReferrerInfo
336
- /** 启动小程序的[场景值](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */
337
- scene: number
338
- /** shareTicket,详见[获取更多转发信息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */
339
- shareTicket: string
340
- }
341
-
342
- namespace LaunchOptionsApp {
343
- interface ReferrerInfo {
344
- /** 来源小程序、公众号或 App 的 appId */
345
- appId: string
346
- /** 来源小程序传过来的数据,scene=1037或1038时支持 */
347
- extraData: IAnyObject
348
- }
326
+ /** @illustrate 未知错误 */
327
+ 13010
328
+ /** user is not authorized
329
+ * @illustrate 用户未授权
330
+ */
331
+ 13019
332
+ /** invalid parameter
333
+ * @illustrate 参数无效
334
+ */
335
+ 13011
336
+ /** parse NdefMessage failed
337
+ * @illustrate 将参数解析为 NdefMessage 失败
338
+ */
339
+ 13012
340
+ /** NFC tag has not been discovered
341
+ * @illustrate 未扫描到NFC标签
342
+ */
343
+ 13013
344
+ /** invalid tech
345
+ * @illustrate 无效的标签技术
346
+ */
347
+ 13014
348
+ /** unavailable tech
349
+ * @illustrate 从标签上获取对应技术失败
350
+ */
351
+ 13015
352
+ /** connect fail
353
+ * @illustrate 连接失败
354
+ */
355
+ 13016
356
+ /** system internal error
357
+ * @illustrate 相关读写操作失败
358
+ */
359
+ 13017
360
+ /** NFC discovery has not started
361
+ * @illustrate 尝试在未开始 NFC 扫描时停止 NFC 扫描
362
+ */
363
+ 13018
364
+ /** NFC discovery already started
365
+ * @illustrate 已经开始 NFC 扫描
366
+ */
367
+ 13021
368
+ /** Tech already connected
369
+ * @illustrate 标签已经连接
370
+ */
371
+ 13022
372
+ /** Tech has not connected
373
+ * @illustrate 尝试在未连接标签时断开连接
374
+ */
375
+ 13023
376
+ /** function not support
377
+ * @illustrate 当前标签技术不支持该功能
378
+ */
379
+ 13024
349
380
  }
350
381
 
351
382
  // Events