@ray-js/api 1.6.0-beta.8 → 1.6.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.
Files changed (81) hide show
  1. package/@types/BaseKit.d.ts +837 -37
  2. package/@types/BizKit.d.ts +1831 -85
  3. package/@types/DeviceKit.d.ts +581 -58
  4. package/@types/HomeKit.d.ts +0 -74
  5. package/@types/MiniKit.d.ts +411 -8
  6. package/@types/api-cloud.d.ts +145 -0
  7. package/@types/api-extend.d.ts +42 -10
  8. package/@types/api.d.ts +3 -0
  9. package/@types/gateway.d.ts +146 -0
  10. package/@types/health.d.ts +309 -0
  11. package/lib/{BaseKit-3.11.0.d.ts → BaseKit-3.14.3.d.ts} +29 -1
  12. package/lib/{BaseKit-3.11.0.js → BaseKit-3.14.3.js} +32 -1
  13. package/lib/BizKit-4.10.4.d.ts +84 -0
  14. package/lib/{BizKit-3.2.7.js → BizKit-4.10.4.js} +46 -5
  15. package/lib/{DeviceKit-3.3.1.d.ts → DeviceKit-4.9.0.d.ts} +22 -1
  16. package/lib/{DeviceKit-3.3.1.js → DeviceKit-4.9.0.js} +66 -0
  17. package/lib/HomeKit-3.1.4.d.ts +0 -1
  18. package/lib/MapKit-3.4.13.d.ts +0 -1
  19. package/lib/{MiniKit-3.1.0.d.ts → MiniKit-3.12.1.d.ts} +11 -1
  20. package/lib/{MiniKit-3.1.0.js → MiniKit-3.12.1.js} +12 -1
  21. package/lib/OutdoorKit-1.0.4.d.ts +0 -1
  22. package/lib/P2PKit-2.0.3.d.ts +0 -1
  23. package/lib/PlayNetKit-1.1.3.d.ts +24 -24
  24. package/lib/all-kits.d.ts +5 -5
  25. package/lib/all-kits.js +5 -5
  26. package/lib/cloud/device.d.ts +3 -3
  27. package/lib/cloud/gateway.d.ts +11 -0
  28. package/lib/cloud/gateway.js +39 -0
  29. package/lib/cloud/health.d.ts +19 -0
  30. package/lib/cloud/health.js +71 -0
  31. package/lib/cloud/index.d.ts +3 -0
  32. package/lib/cloud/index.js +6 -1
  33. package/lib/cloud/interface.d.ts +40 -1
  34. package/lib/cloud/laser-clean/index.d.ts +3 -0
  35. package/lib/cloud/laser-clean/index.js +3 -0
  36. package/lib/cloud/laser-clean/map.d.ts +3 -0
  37. package/lib/cloud/laser-clean/map.js +4 -0
  38. package/lib/cloud/laser-clean/record.d.ts +3 -0
  39. package/lib/cloud/laser-clean/record.js +4 -0
  40. package/lib/cloud/laser-clean/voice.d.ts +2 -0
  41. package/lib/cloud/laser-clean/voice.js +3 -0
  42. package/lib/cloud/recipe/basket.js +1 -0
  43. package/lib/cloud/recipe/custom.js +1 -0
  44. package/lib/cloud/recipe/menu.js +1 -0
  45. package/lib/cloud/recipe/query.js +1 -0
  46. package/lib/cloud/recipe/score.js +1 -0
  47. package/lib/cloud/recipe/star.js +1 -0
  48. package/lib/getBoundingClientRect/index.thing.js +1 -0
  49. package/lib/getBoundingClientRect/index.wechat.js +1 -0
  50. package/lib/getCdnUrl/index.thing.js +13 -8
  51. package/lib/hideTabBar/index.d.ts +4 -5
  52. package/lib/index.d.ts +0 -1
  53. package/lib/navigateBack/index.d.ts +0 -1
  54. package/lib/navigateTo/index.d.ts +0 -1
  55. package/lib/panel/devInfo/index.js +7 -1
  56. package/lib/panel/i18n/index.js +4 -0
  57. package/lib/panel/i18n/index.wechat.js +4 -0
  58. package/lib/panel/publishDps.js +2 -0
  59. package/lib/reLaunch/index.d.ts +0 -1
  60. package/lib/redirectTo/index.d.ts +0 -1
  61. package/lib/redirectTo/index.js +1 -0
  62. package/lib/requestCloud/index.d.ts +0 -1
  63. package/lib/setNavigationBarColor/index.d.ts +0 -1
  64. package/lib/setNavigationBarTitle/index.d.ts +0 -1
  65. package/lib/showTabBar/index.d.ts +4 -5
  66. package/lib/switchTab/index.d.ts +0 -1
  67. package/lib/utils.wechat.js +1 -0
  68. package/lib/viewAPI.d.ts +1 -1
  69. package/lib/viewAPI.js +2 -1
  70. package/package.json +8 -8
  71. package/lib/BizKit-3.2.7.d.ts +0 -46
  72. package/lib/cloud/doorlock/README.md +0 -62
  73. package/lib/cloud/doorlock/auth.md +0 -323
  74. package/lib/cloud/doorlock/device.md +0 -265
  75. package/lib/cloud/doorlock/log.md +0 -153
  76. package/lib/cloud/doorlock/member-opmode.md +0 -279
  77. package/lib/cloud/doorlock/member.md +0 -276
  78. package/lib/cloud/doorlock/offline-pwd.md +0 -155
  79. package/lib/cloud/doorlock/temp-pwd.md +0 -362
  80. package/lib/cloud/doorlock/unlock-method.md +0 -121
  81. package/lib/cloud/doorlock/unlock.md +0 -222
@@ -1,9 +1,356 @@
1
1
  /**
2
2
  * BizKit
3
3
  *
4
- * @version 3.3.1
4
+ * @version 4.10.4
5
5
  */
6
6
  declare namespace ty {
7
+ /**
8
+ * 获取历史消息
9
+ */
10
+ export function getAIAssistantHistory(params: {
11
+ /** 数量,不传递默认值30 */
12
+ size: number
13
+ /** primaryId */
14
+ primaryId: number
15
+ /** 消息标识 */
16
+ requestId: string
17
+ /** 类型, TEXT_FINISH SKILL_FINISH */
18
+ type: string
19
+ /** 渠道 可选参数,不传表示首页AI组手 */
20
+ channel: string
21
+ complete?: () => void
22
+ success?: (params: {
23
+ /** 列表数据 */
24
+ data: string
25
+ /** 渠道 */
26
+ channel: string
27
+ }) => void
28
+ fail?: (params: {
29
+ errorMsg: string
30
+ errorCode: string | number
31
+ innerError: {
32
+ errorCode: string | number
33
+ errorMsg: string
34
+ }
35
+ }) => void
36
+ }): void
37
+
38
+ /**
39
+ * 获取AI助手组历史消息
40
+ */
41
+ export function getAIAssistantGroupHistory(params: {
42
+ /** 数量,不传递默认值30 */
43
+ size: number
44
+ /** 分页依据,传入0查询最近n条,其他值后根据 id < primaryId 往前查询n条 */
45
+ primaryId: number
46
+ /** 渠道列表,数组其中一个元素支持传递null表示原有AI组手,整个数组为空时,查询所有数据 */
47
+ channels?: string[]
48
+ /** 会话列表,数组其中一个元素支持传递null,整个数组为空时,查询所有数据 */
49
+ sessions?: string[]
50
+ complete?: () => void
51
+ success?: (params: {
52
+ /** 列表数据个数 */
53
+ size: number
54
+ /** 数据列表 */
55
+ list: GroupHistoryResItem[][]
56
+ }) => void
57
+ fail?: (params: {
58
+ errorMsg: string
59
+ errorCode: string | number
60
+ innerError: {
61
+ errorCode: string | number
62
+ errorMsg: string
63
+ }
64
+ }) => void
65
+ }): void
66
+
67
+ /**
68
+ * 删除消息
69
+ */
70
+ export function deleteAIAssistant(params: {
71
+ /** primaryId */
72
+ primaryId: number
73
+ complete?: () => void
74
+ success?: (params: null) => void
75
+ fail?: (params: {
76
+ errorMsg: string
77
+ errorCode: string | number
78
+ innerError: {
79
+ errorCode: string | number
80
+ errorMsg: string
81
+ }
82
+ }) => void
83
+ }): void
84
+
85
+ /**
86
+ * 发送消息
87
+ */
88
+ export function sendAIAssistant(params: {
89
+ /** 消息 */
90
+ block: string
91
+ /** 可选参数 */
92
+ options: string
93
+ /** 类型 TEXT/SKILL/其他任意字符CUSTOMXX,存在DB中的类型是TEXT_FINISH, SKILL_FINISH, CUSTOMXX_FINISH */
94
+ type: string
95
+ /** 可选字段,如果传递了,则会绑定到该消息上,如果没有传递,则会生成一个新的requestId */
96
+ requestId?: string
97
+ /** 渠道, 兼容历史不传从options中获取 */
98
+ channel?: string
99
+ /** 会话 */
100
+ session?: string
101
+ complete?: () => void
102
+ success?: (params: {
103
+ /** 单次对话消息标识 */
104
+ requestId: string
105
+ /** primaryId */
106
+ primaryId: number
107
+ /** 发送消息 200成功 -2001 发送失败 */
108
+ code: string
109
+ }) => void
110
+ fail?: (params: {
111
+ errorMsg: string
112
+ errorCode: string | number
113
+ innerError: {
114
+ errorCode: string | number
115
+ errorMsg: string
116
+ }
117
+ }) => void
118
+ }): void
119
+
120
+ /**
121
+ * 数据初始
122
+ */
123
+ export function createAIAssistant(params?: {
124
+ complete?: () => void
125
+ success?: (params: null) => void
126
+ fail?: (params: {
127
+ errorMsg: string
128
+ errorCode: string | number
129
+ innerError: {
130
+ errorCode: string | number
131
+ errorMsg: string
132
+ }
133
+ }) => void
134
+ }): void
135
+
136
+ /**
137
+ * 移除消息监听
138
+ *获取单次对话消息标识
139
+ */
140
+ export function getAIAssistantRequestId(params?: {
141
+ complete?: () => void
142
+ success?: (params: {
143
+ /** 单次对话消息标识 */
144
+ requestId: string
145
+ }) => void
146
+ fail?: (params: {
147
+ errorMsg: string
148
+ errorCode: string | number
149
+ innerError: {
150
+ errorCode: string | number
151
+ errorMsg: string
152
+ }
153
+ }) => void
154
+ }): void
155
+
156
+ /**
157
+ * 插入数据
158
+ */
159
+ export function insertAIAssistantInfo(params: {
160
+ /** 消息标识:如果requestId是新生成的,则会作为宿主消息查询出来;如果是用的其他消息的requestId,列表查询的时候则会被绑定到这条消息上返回 */
161
+ requestId: string
162
+ /**
163
+ * 类型, 自定义类型
164
+ * 保留字段:TEXT_FINISH,CUSTOM_FINISH, 这两个字符串会被插件默认当做宿主消息,会被当做一个气泡,其他类型的比如SKILL_FINISH,XX_FINISH,都会绑定到该消息上,删除的时候会被一起删除掉
165
+ * 1、如果你想插入一条河其他消息绑定的,则不能传入 TEXT_FINISH, CUSTOM_FINISH,传入其他的,比如:XX1_FINISH,requestId则需要传入绑定的那条消息的requestId
166
+ * 2、如果你想插入一条消息作为单独的气泡,则需要传入 TEXT_FINISH 或者 CUSTOM_FINISH,requestId则需要重新生成,可以通过插件提供的api获取。
167
+ * 3、消息的绑定也会根据插入的source值相关,只有source相同的才会绑定。比如requestId==1的数据在数据库中有两条,source分别是1和2,插入内容根据source匹配绑定到对应的消息上。
168
+ */
169
+ type: string
170
+ /** 消息内容: 消息内容完全业务方自己定义,如果业务复杂,涉及到自定义的type很多,需要业务自己规划设计好data的结构进行区分。 */
171
+ data: string
172
+ /** 错误码 */
173
+ code: string
174
+ /** 错误信息 */
175
+ message: string
176
+ /**
177
+ * 消息来源 1. 本地 2. 云端
178
+ * 消息的绑定会根据插入的source值相关,只有source相同的才会绑定。比如requestId==1的数据在数据库中有两条,source分别是1和2,插入内容根据source匹配绑定到对应的消息上。
179
+ */
180
+ source: number
181
+ /** 渠道 可选参数,不传表示首页AI组手 */
182
+ channel?: string
183
+ /** 会话 */
184
+ session?: string
185
+ /** 发送/接受ws 时候携带数据 */
186
+ options?: string
187
+ complete?: () => void
188
+ success?: (params: {
189
+ /** 主键 */
190
+ primaryId: number
191
+ }) => void
192
+ fail?: (params: {
193
+ errorMsg: string
194
+ errorCode: string | number
195
+ innerError: {
196
+ errorCode: string | number
197
+ errorMsg: string
198
+ }
199
+ }) => void
200
+ }): void
201
+
202
+ /**
203
+ * 更新数据
204
+ */
205
+ export function updateAIAssistantInfo(params: {
206
+ /** 消息标识 */
207
+ primaryId: number
208
+ /** 消息内容 */
209
+ data?: string
210
+ /** 错误码 */
211
+ code?: string
212
+ /** 错误信息 */
213
+ message?: string
214
+ /** 消息来源 1. 本地 2. 云端 */
215
+ source?: string
216
+ /** 类型,以_FINISH结尾 */
217
+ type: string
218
+ /** 渠道 可选参数,不传表示首页AI组手 */
219
+ channel?: string
220
+ /** 会话 */
221
+ session?: string
222
+ /** 发送/接受ws 时候携带数据 */
223
+ options?: string
224
+ complete?: () => void
225
+ success?: (params: null) => void
226
+ fail?: (params: {
227
+ errorMsg: string
228
+ errorCode: string | number
229
+ innerError: {
230
+ errorCode: string | number
231
+ errorMsg: string
232
+ }
233
+ }) => void
234
+ }): void
235
+
236
+ /**
237
+ * 获取语音助手展示类型
238
+ */
239
+ export function getSpeechDisplayType(params?: {
240
+ complete?: () => void
241
+ success?: (params: {
242
+ /** 0 不展示 1 显示老助手 2 显示新助手 */
243
+ type: number
244
+ }) => void
245
+ fail?: (params: {
246
+ errorMsg: string
247
+ errorCode: string | number
248
+ innerError: {
249
+ errorCode: string | number
250
+ errorMsg: string
251
+ }
252
+ }) => void
253
+ }): void
254
+
255
+ /**
256
+ * 关闭AI助手
257
+ */
258
+ export function disableAIAssistant(params?: {
259
+ complete?: () => void
260
+ success?: (params: null) => void
261
+ fail?: (params: {
262
+ errorMsg: string
263
+ errorCode: string | number
264
+ innerError: {
265
+ errorCode: string | number
266
+ errorMsg: string
267
+ }
268
+ }) => void
269
+ }): void
270
+
271
+ /**
272
+ * 打开AI助手
273
+ */
274
+ export function enableAIAssistant(params?: {
275
+ complete?: () => void
276
+ success?: (params: null) => void
277
+ fail?: (params: {
278
+ errorMsg: string
279
+ errorCode: string | number
280
+ innerError: {
281
+ errorCode: string | number
282
+ errorMsg: string
283
+ }
284
+ }) => void
285
+ }): void
286
+
287
+ /**
288
+ * 清除数据
289
+ */
290
+ export function deleteAIAssistantDbSource(params: {
291
+ /** 清除家庭数据, 不传表示清除当前家庭 */
292
+ homeId: string
293
+ complete?: () => void
294
+ success?: (params: null) => void
295
+ fail?: (params: {
296
+ errorMsg: string
297
+ errorCode: string | number
298
+ innerError: {
299
+ errorCode: string | number
300
+ errorMsg: string
301
+ }
302
+ }) => void
303
+ }): void
304
+
305
+ /**
306
+ * 获取单条数据
307
+ */
308
+ export function getSingleAIAssistant(params: {
309
+ /** 主键 */
310
+ primaryId: number
311
+ complete?: () => void
312
+ success?: (params: {
313
+ /** 主键 */
314
+ primaryId: number
315
+ /** 消息标识 */
316
+ requestId: string
317
+ /** 消息来源 1. 本地 2. 云端 */
318
+ source: number
319
+ /** 消息内容 */
320
+ data: string
321
+ /** 错误码 */
322
+ code: number
323
+ /** 类型 */
324
+ type: string
325
+ /** 创建时间 */
326
+ createTime: number
327
+ }) => void
328
+ fail?: (params: {
329
+ errorMsg: string
330
+ errorCode: string | number
331
+ innerError: {
332
+ errorCode: string | number
333
+ errorMsg: string
334
+ }
335
+ }) => void
336
+ }): void
337
+
338
+ /**
339
+ * 是否支持老语音助手
340
+ */
341
+ export function isSupportOldSpeech(params?: {
342
+ complete?: () => void
343
+ success?: (params: boolean) => void
344
+ fail?: (params: {
345
+ errorMsg: string
346
+ errorCode: string | number
347
+ innerError: {
348
+ errorCode: string | number
349
+ errorMsg: string
350
+ }
351
+ }) => void
352
+ }): void
353
+
7
354
  /**
8
355
  * atop接口
9
356
  */
@@ -42,6 +389,47 @@ declare namespace ty {
42
389
  }) => void
43
390
  }): void
44
391
 
392
+ /**
393
+ * highway面板接口
394
+ */
395
+ export function apiRequestByHighwayRestful(params: {
396
+ /**
397
+ * 域名
398
+ */
399
+ host?: string
400
+ /**
401
+ * 请求API, 严格遵循restful标准格式,"/"开头
402
+ * e.g. /v1.0/m/thing/test/path/to/my/api
403
+ */
404
+ api: string
405
+ /**
406
+ * 数据不会被加密,以 HEADER 形式传递
407
+ * 每一个request都包含了默认的公共参数,header会覆盖默认的公共参数
408
+ */
409
+ header?: Record<string, any>
410
+ /** 数据会被加密,最终以 QUERY 形式传递 */
411
+ query?: Record<string, any>
412
+ /** 只针对 POST 请求,数据会被加密,最终以 BODY 形式传递 */
413
+ body?: Record<string, any>
414
+ /** http请求方式 */
415
+ method?: HighwayMethod
416
+ complete?: () => void
417
+ success?: (params: {
418
+ /** 序列化返回结果 */
419
+ result: {}
420
+ /** apiName */
421
+ api: string
422
+ }) => void
423
+ fail?: (params: {
424
+ errorMsg: string
425
+ errorCode: string | number
426
+ innerError: {
427
+ errorCode: string | number
428
+ errorMsg: string
429
+ }
430
+ }) => void
431
+ }): void
432
+
45
433
  /**
46
434
  * 单次点 事件埋点
47
435
  */
@@ -76,7 +464,233 @@ declare namespace ty {
76
464
  /** (begin,track,end)独有字段(会按照打点顺序组装成数组) */
77
465
  infos: Record<string, {}>
78
466
  complete?: () => void
79
- success?: (params: null) => void
467
+ success?: (params: null) => void
468
+ fail?: (params: {
469
+ errorMsg: string
470
+ errorCode: string | number
471
+ innerError: {
472
+ errorCode: string | number
473
+ errorMsg: string
474
+ }
475
+ }) => void
476
+ }): void
477
+
478
+ /**
479
+ * 链路点 发送事件埋点
480
+ *发送一个(时长类)事件
481
+ */
482
+ export function trackEvent(params: {
483
+ /** 事件名称(事件平台生成) */
484
+ eventName: string
485
+ /** 事件唯一ID (在同一条链路上,begin,track,end 的标识) */
486
+ identifier: string
487
+ /** 所有事件(begin,track,end)公有字段(该链路上,后面打点的数据会覆盖前面点数据,如下example中非data中的字段,ps:beginTime,endTime默认会打上) */
488
+ attributes: Record<string, {}>
489
+ /** (begin,track,end)独有字段(会按照打点顺序组装成数组) */
490
+ infos: Record<string, {}>
491
+ complete?: () => void
492
+ success?: (params: null) => void
493
+ fail?: (params: {
494
+ errorMsg: string
495
+ errorCode: string | number
496
+ innerError: {
497
+ errorCode: string | number
498
+ errorMsg: string
499
+ }
500
+ }) => void
501
+ }): void
502
+
503
+ /**
504
+ * 链路点 结束事件埋点
505
+ *开始一个(时长类)事件
506
+ */
507
+ export function endEvent(params: {
508
+ /** 事件名称(事件平台生成) */
509
+ eventName: string
510
+ /** 事件唯一ID (在同一条链路上,begin,track,end 的标识) */
511
+ identifier: string
512
+ /** 所有事件(begin,track,end)公有字段(该链路上,后面打点的数据会覆盖前面点数据,如下example中非data中的字段,ps:beginTime,endTime默认会打上) */
513
+ attributes: Record<string, {}>
514
+ /** (begin,track,end)独有字段(会按照打点顺序组装成数组) */
515
+ infos: Record<string, {}>
516
+ complete?: () => void
517
+ success?: (params: null) => void
518
+ fail?: (params: {
519
+ errorMsg: string
520
+ errorCode: string | number
521
+ innerError: {
522
+ errorCode: string | number
523
+ errorMsg: string
524
+ }
525
+ }) => void
526
+ }): void
527
+
528
+ /**
529
+ * 链路埋点 支持10个链路点,链路下标:0 - 9
530
+ */
531
+ export function eventLink(params: {
532
+ /** 链路点位置,目前只支持10个链路点,0 - 9 */
533
+ linkIndex: number
534
+ /** 链路唯一id,保证唯一性,建议格式是:链路关键词_小程序id */
535
+ linkId: string
536
+ /** 业务扩展参数 map转成string */
537
+ params: string
538
+ complete?: () => void
539
+ success?: (params: null) => void
540
+ fail?: (params: {
541
+ errorMsg: string
542
+ errorCode: string | number
543
+ innerError: {
544
+ errorCode: string | number
545
+ errorMsg: string
546
+ }
547
+ }) => void
548
+ }): void
549
+
550
+ /**
551
+ * 业务侧定义的性能数据,会显示在性能工具中
552
+ */
553
+ export function performanceEvent(params?: {
554
+ /**
555
+ * 性能数据, 这里的数据会以点击小程序的时间为起点,到调用performance方法的时间为终点自动计算耗时
556
+ * example: ty.performanceEvent({launchData: 'map_render_time'})
557
+ */
558
+ launchData?: string
559
+ /** 业务自定义性能数据,会以key-value的形式展示在性能工具中 */
560
+ perfData?: Record<string, string>
561
+ complete?: () => void
562
+ success?: (params: null) => void
563
+ fail?: (params: {
564
+ errorMsg: string
565
+ errorCode: string | number
566
+ innerError: {
567
+ errorCode: string | number
568
+ errorMsg: string
569
+ }
570
+ }) => void
571
+ }): void
572
+
573
+ /**
574
+ * 拿到当前App的业务信息
575
+ */
576
+ export function getAppInfo(params?: {
577
+ complete?: () => void
578
+ success?: (params: {
579
+ /**
580
+ * App信息
581
+ * serverTimestamp 云端时间戳
582
+ * appVersion app版本
583
+ * language app语言包
584
+ * countryCode 国家码
585
+ * regionCode 地区码, 在RN Api中被当作“service”字段
586
+ */
587
+ serverTimestamp: number
588
+ appVersion: string
589
+ language: string
590
+ countryCode: string
591
+ regionCode: string
592
+ /** appName app名称 */
593
+ appName: string
594
+ /** appIcon app图标 */
595
+ appIcon: string
596
+ /**
597
+ * app环境
598
+ * 0: 日常
599
+ * 1: 预发
600
+ * 2: 线上
601
+ */
602
+ appEnv?: number
603
+ /** app包名 */
604
+ appBundleId: string
605
+ /** app scheme */
606
+ appScheme: string
607
+ /** app id */
608
+ appId: string
609
+ /** app clientId */
610
+ clientId?: string
611
+ }) => void
612
+ fail?: (params: {
613
+ errorMsg: string
614
+ errorCode: string | number
615
+ innerError: {
616
+ errorCode: string | number
617
+ errorMsg: string
618
+ }
619
+ }) => void
620
+ }): void
621
+
622
+ /**
623
+ * 拿到当前连接的wifi的ssid
624
+ */
625
+ export function getCurrentWifiSSID(params?: {
626
+ complete?: () => void
627
+ success?: (params: {
628
+ /** 拿到当前连接的wifi的ssid */
629
+ ssId: string
630
+ }) => void
631
+ fail?: (params: {
632
+ errorMsg: string
633
+ errorCode: string | number
634
+ innerError: {
635
+ errorCode: string | number
636
+ errorMsg: string
637
+ }
638
+ }) => void
639
+ }): void
640
+
641
+ /**
642
+ * 获取NG配置
643
+ */
644
+ export function getNGConfigByKeys(params: {
645
+ /** ng配置的key */
646
+ keys: string[]
647
+ complete?: () => void
648
+ success?: (params: {
649
+ /** ng配置 */
650
+ config: Record<string, {}>
651
+ }) => void
652
+ fail?: (params: {
653
+ errorMsg: string
654
+ errorCode: string | number
655
+ innerError: {
656
+ errorCode: string | number
657
+ errorMsg: string
658
+ }
659
+ }) => void
660
+ }): void
661
+
662
+ /**
663
+ * 获取配置中心的配置
664
+ */
665
+ export function getConfigByKeys(params: {
666
+ /**
667
+ * 三段式结构对应配置中心的业务配置
668
+ * 举例:["oem:config:open_device_network"]
669
+ */
670
+ keys: string[]
671
+ complete?: () => void
672
+ success?: (params: {
673
+ /** ng配置 */
674
+ config: Record<string, {}>
675
+ }) => void
676
+ fail?: (params: {
677
+ errorMsg: string
678
+ errorCode: string | number
679
+ innerError: {
680
+ errorCode: string | number
681
+ errorMsg: string
682
+ }
683
+ }) => void
684
+ }): void
685
+
686
+ /**
687
+ * 获取三方服务信息
688
+ */
689
+ export function getThirdPartyServiceInfo(params: {
690
+ /** 三方服务列表 ThirdPartyType */
691
+ types: number[]
692
+ complete?: () => void
693
+ success?: (params: ThirdPartyServiceInfo[]) => void
80
694
  fail?: (params: {
81
695
  errorMsg: string
82
696
  errorCode: string | number
@@ -88,20 +702,18 @@ declare namespace ty {
88
702
  }): void
89
703
 
90
704
  /**
91
- * 链路点 发送事件埋点
92
- *发送一个(时长类)事件
705
+ * 打开三方小程序
93
706
  */
94
- export function trackEvent(params: {
95
- /** 事件名称(事件平台生成) */
96
- eventName: string
97
- /** 事件唯一ID (在同一条链路上,begin,track,end 的标识) */
98
- identifier: string
99
- /** 所有事件(begin,track,end)公有字段(该链路上,后面打点的数据会覆盖前面点数据,如下example中非data中的字段,ps:beginTime,endTime默认会打上) */
100
- attributes: Record<string, {}>
101
- /** (begin,track,end)独有字段(会按照打点顺序组装成数组) */
102
- infos: Record<string, {}>
707
+ export function openThirdPartyMiniProgram(params: {
708
+ /** 三方小程序类型 ThirdPartyMiniProgramType */
709
+ type: number
710
+ /** 三方小程序参数 */
711
+ params: Record<string, {}>
103
712
  complete?: () => void
104
- success?: (params: null) => void
713
+ success?: (params: {
714
+ /** 三方小程序结果 */
715
+ data: Record<string, {}>
716
+ }) => void
105
717
  fail?: (params: {
106
718
  errorMsg: string
107
719
  errorCode: string | number
@@ -113,20 +725,14 @@ declare namespace ty {
113
725
  }): void
114
726
 
115
727
  /**
116
- * 链路点 结束事件埋点
117
- *开始一个(时长类)事件
728
+ * 获取云端环境
118
729
  */
119
- export function endEvent(params: {
120
- /** 事件名称(事件平台生成) */
121
- eventName: string
122
- /** 事件唯一ID (在同一条链路上,begin,track,end 的标识) */
123
- identifier: string
124
- /** 所有事件(begin,track,end)公有字段(该链路上,后面打点的数据会覆盖前面点数据,如下example中非data中的字段,ps:beginTime,endTime默认会打上) */
125
- attributes: Record<string, {}>
126
- /** (begin,track,end)独有字段(会按照打点顺序组装成数组) */
127
- infos: Record<string, {}>
730
+ export function getCloudEnv(params?: {
128
731
  complete?: () => void
129
- success?: (params: null) => void
732
+ success?: (params: {
733
+ /** 云端环境 CloudEnvType */
734
+ env: number
735
+ }) => void
130
736
  fail?: (params: {
131
737
  errorMsg: string
132
738
  errorCode: string | number
@@ -138,41 +744,13 @@ declare namespace ty {
138
744
  }): void
139
745
 
140
746
  /**
141
- * 拿到当前App的业务信息
747
+ * 当前环境是否支持小程序
142
748
  */
143
- export function getAppInfo(params?: {
749
+ export function isMiniAppAvailable(params?: {
144
750
  complete?: () => void
145
751
  success?: (params: {
146
- /**
147
- * App信息
148
- * serverTimestamp 云端时间戳
149
- * appVersion app版本
150
- * language app语言包
151
- * countryCode 国家码
152
- * regionCode 地区码, 在RN Api中被当作“service”字段
153
- */
154
- serverTimestamp: number
155
- appVersion: string
156
- language: string
157
- countryCode: string
158
- regionCode: string
159
- /** appName app名称 */
160
- appName: string
161
- /** appIcon app图标 */
162
- appIcon: string
163
- /**
164
- * app环境
165
- * 0: 日常
166
- * 1: 预发
167
- * 2: 线上
168
- */
169
- appEnv?: number
170
- /** app包名 */
171
- appBundleId: string
172
- /** app scheme */
173
- appScheme: string
174
- /** app id */
175
- appId: string
752
+ /** 是否支持小程序环境 */
753
+ availalble: boolean
176
754
  }) => void
177
755
  fail?: (params: {
178
756
  errorMsg: string
@@ -185,13 +763,13 @@ declare namespace ty {
185
763
  }): void
186
764
 
187
765
  /**
188
- * 拿到当前连接的wifissid
766
+ * 获取当前Apptab信息(仅Android)
189
767
  */
190
- export function getCurrentWifiSSID(params?: {
768
+ export function getAppTabInfo(params?: {
191
769
  complete?: () => void
192
770
  success?: (params: {
193
- /** 拿到当前连接的wifi的ssid */
194
- ssId: string
771
+ /** tab信息 */
772
+ tabInfo: AppTabInfo[]
195
773
  }) => void
196
774
  fail?: (params: {
197
775
  errorMsg: string
@@ -241,6 +819,70 @@ declare namespace ty {
241
819
  }) => void
242
820
  }): void
243
821
 
822
+ /**
823
+ * IAP支付方法
824
+ */
825
+ export function iapPay(params: {
826
+ /** 订单ID */
827
+ orderID: string
828
+ /** 商品ID */
829
+ productID: string
830
+ /** 订阅单预支付code */
831
+ preFlowCode: string
832
+ /** 1: 订阅 0: 非订阅 */
833
+ subscription?: number
834
+ /**
835
+ * 指定订阅升级/降级期间的按比例分配模式
836
+ * Google提供的几种模式:
837
+ * int UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0;
838
+ * int IMMEDIATE_WITH_TIME_PRORATION = 1;
839
+ * int IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2;
840
+ * int IMMEDIATE_WITHOUT_PRORATION = 3;
841
+ * int DEFERRED = 4
842
+ */
843
+ billing_mode?: number
844
+ /** 之前的sku商品,用于筛选和获取历史订单的令牌做升级处理 */
845
+ previous_sku?: string
846
+ complete?: () => void
847
+ success?: (params: {
848
+ /** 订单ID */
849
+ orderID?: string
850
+ /** 选择订单为备选结算处理token,用于后台主动上报备选结算报告单 */
851
+ token?: string
852
+ /** 选择为备选结算处理的订单 */
853
+ products?: string
854
+ /** 0:iap 1:备选结算 */
855
+ paymentType?: number
856
+ }) => void
857
+ fail?: (params: {
858
+ errorMsg: string
859
+ errorCode: string | number
860
+ innerError: {
861
+ errorCode: string | number
862
+ errorMsg: string
863
+ }
864
+ }) => void
865
+ }): void
866
+
867
+ /**
868
+ * 支付类型
869
+ */
870
+ export function iapType(params?: {
871
+ complete?: () => void
872
+ success?: (params: {
873
+ /** 支付类型 0:三方支付; 1:苹果支付,2:google支付,3:google支付支持备选结算 */
874
+ data: number
875
+ }) => void
876
+ fail?: (params: {
877
+ errorMsg: string
878
+ errorCode: string | number
879
+ innerError: {
880
+ errorCode: string | number
881
+ errorMsg: string
882
+ }
883
+ }) => void
884
+ }): void
885
+
244
886
  /**
245
887
  * 图片上传
246
888
  */
@@ -249,7 +891,7 @@ declare namespace ty {
249
891
  filePath: string
250
892
  /** business type, config via backend ng */
251
893
  bizType: string
252
- /** file type */
894
+ /** file type, ios necessary */
253
895
  contentType?: string
254
896
  /** polling interval of big file in second, default is 2 second */
255
897
  delayTime?: number
@@ -270,6 +912,53 @@ declare namespace ty {
270
912
  }) => void
271
913
  }): void
272
914
 
915
+ /**
916
+ * 视频上传
917
+ */
918
+ export function uploadVideo(params: {
919
+ /** the file path */
920
+ filePath: string
921
+ /** business type, config via backend ng */
922
+ bizType: string
923
+ /** file type, ios necessary */
924
+ contentType?: string
925
+ complete?: () => void
926
+ success?: (params: {
927
+ /** The json string returned by the request */
928
+ result: string
929
+ }) => void
930
+ fail?: (params: {
931
+ errorMsg: string
932
+ errorCode: string | number
933
+ innerError: {
934
+ errorCode: string | number
935
+ errorMsg: string
936
+ }
937
+ }) => void
938
+ }): void
939
+
940
+ /**
941
+ * 创建实时活动
942
+ */
943
+ export function createLiveActivity(params: {
944
+ /** 实时通知类型 */
945
+ activityType?: any
946
+ /** 实时通知ID */
947
+ activityId: string
948
+ /** 实时通知参数 */
949
+ data: Record<string, string>
950
+ complete?: () => void
951
+ success?: (params: null) => void
952
+ fail?: (params: {
953
+ errorMsg: string
954
+ errorCode: string | number
955
+ innerError: {
956
+ errorCode: string | number
957
+ errorMsg: string
958
+ }
959
+ }) => void
960
+ }): void
961
+
273
962
  /**
274
963
  * 获取手机当前地区语言 zh-hans 、en-GB
275
964
  */
@@ -308,6 +997,59 @@ declare namespace ty {
308
997
  }) => void
309
998
  }): void
310
999
 
1000
+ /**
1001
+ * 注册界面刷新
1002
+ */
1003
+ export function registerPageRefreshListener(params?: {
1004
+ complete?: () => void
1005
+ success?: (params: null) => void
1006
+ fail?: (params: {
1007
+ errorMsg: string
1008
+ errorCode: string | number
1009
+ innerError: {
1010
+ errorCode: string | number
1011
+ errorMsg: string
1012
+ }
1013
+ }) => void
1014
+ }): void
1015
+
1016
+ /**
1017
+ * 传入key值,获取对应NG元数据
1018
+ */
1019
+ export function getNgRawData(params: {
1020
+ /** 要获取元数据的key值,支持x.y.z格式 */
1021
+ rawKey: string
1022
+ complete?: () => void
1023
+ success?: (params: {
1024
+ /** 返回元数据 */
1025
+ rawData: string
1026
+ }) => void
1027
+ fail?: (params: {
1028
+ errorMsg: string
1029
+ errorCode: string | number
1030
+ innerError: {
1031
+ errorCode: string | number
1032
+ errorMsg: string
1033
+ }
1034
+ }) => void
1035
+ }): void
1036
+
1037
+ /**
1038
+ * 获取在线客户电子
1039
+ */
1040
+ export function getOnlineCustomerService(params?: {
1041
+ complete?: () => void
1042
+ success?: (params: { url: string }) => void
1043
+ fail?: (params: {
1044
+ errorMsg: string
1045
+ errorCode: string | number
1046
+ innerError: {
1047
+ errorCode: string | number
1048
+ errorMsg: string
1049
+ }
1050
+ }) => void
1051
+ }): void
1052
+
311
1053
  /**
312
1054
  * 打开RN面板 (该方法已被废弃, 请使用openPanel替代)
313
1055
  */
@@ -470,7 +1212,8 @@ declare namespace ty {
470
1212
  }): void
471
1213
 
472
1214
  /**
473
- * 根据不同scope值,打开对应的手机系统设置界面
1215
+ * !!!注: 由于审核安全风险,在iOS端调用此方法只会打开当前应用对应的设置界面,不再支持以下scope
1216
+ *根据不同scope值,打开对应的手机系统设置界面
474
1217
  *"Settings"-> 手机设置主界面
475
1218
  *"Settings-Bluetooth" -> 手机蓝牙设置界面
476
1219
  *"Settings-WiFi" -> 手机Wifi设置界面
@@ -525,6 +1268,71 @@ declare namespace ty {
525
1268
  }) => void
526
1269
  }): void
527
1270
 
1271
+ /**
1272
+ * Call this to set the result that your activity will return to its caller
1273
+ */
1274
+ export function setActivityResult(params: {
1275
+ /** The result code to propagate back to the originating activity, often RESULT_CANCELED or RESULT_OK */
1276
+ resultCode: number
1277
+ /** The data to propagate back to the originating activity. */
1278
+ data?: Record<string, {}>
1279
+ complete?: () => void
1280
+ success?: (params: null) => void
1281
+ fail?: (params: {
1282
+ errorMsg: string
1283
+ errorCode: string | number
1284
+ innerError: {
1285
+ errorCode: string | number
1286
+ errorMsg: string
1287
+ }
1288
+ }) => void
1289
+ }): void
1290
+
1291
+ /**
1292
+ * 打开三方App
1293
+ */
1294
+ export function openThirdApp(params: {
1295
+ /** an RFC 2396-compliant, encoded URI */
1296
+ uriString: string
1297
+ /** The name of the application package to handle the intent, or null to allow any application package. */
1298
+ packageName: string
1299
+ complete?: () => void
1300
+ success?: (params: { isCanOpen?: boolean }) => void
1301
+ fail?: (params: {
1302
+ errorMsg: string
1303
+ errorCode: string | number
1304
+ innerError: {
1305
+ errorCode: string | number
1306
+ errorMsg: string
1307
+ }
1308
+ }) => void
1309
+ }): void
1310
+
1311
+ /**
1312
+ * 打开三方App
1313
+ */
1314
+ export function openThirdAppSync(params?: ThirdAppBean): {
1315
+ isCanOpen?: boolean
1316
+ }
1317
+
1318
+ /**
1319
+ * 聚焦系统浏览器通过打开URL
1320
+ */
1321
+ export function openUrlForceDefaultBrowser(params: {
1322
+ /** 要打开的url */
1323
+ url: string
1324
+ complete?: () => void
1325
+ success?: (params: null) => void
1326
+ fail?: (params: {
1327
+ errorMsg: string
1328
+ errorCode: string | number
1329
+ innerError: {
1330
+ errorCode: string | number
1331
+ errorMsg: string
1332
+ }
1333
+ }) => void
1334
+ }): void
1335
+
528
1336
  /**
529
1337
  * 获取支付相关常量信息
530
1338
  */
@@ -539,6 +1347,8 @@ declare namespace ty {
539
1347
  * 2: google支付
540
1348
  */
541
1349
  iapType?: number
1350
+ /** google支付下是否支持用户自选的备选结算 */
1351
+ googleIapEnableUserChoice?: boolean
542
1352
  }) => void
543
1353
  fail?: (params: {
544
1354
  errorMsg: string
@@ -765,7 +1575,7 @@ declare namespace ty {
765
1575
  * miniProgram:微信小程序分享内容
766
1576
  */
767
1577
  contentType: string
768
- /** recipients 邮件收件人 */
1578
+ /** recipients 邮件收件人/短信接收人 */
769
1579
  recipients?: string[]
770
1580
  /** imagePath 图片路径 */
771
1581
  imagePath?: string
@@ -776,7 +1586,49 @@ declare namespace ty {
776
1586
  /** miniProgramInfo 当 contentType == miniProgram 时候使用,且分享渠道必须是微信。 */
777
1587
  miniProgramInfo?: MiniProgramInfo
778
1588
  complete?: () => void
779
- success?: (params: null) => void
1589
+ success?: (params: null) => void
1590
+ fail?: (params: {
1591
+ errorMsg: string
1592
+ errorCode: string | number
1593
+ innerError: {
1594
+ errorCode: string | number
1595
+ errorMsg: string
1596
+ }
1597
+ }) => void
1598
+ }): void
1599
+
1600
+ /**
1601
+ * 获取可分享的渠道列表
1602
+ */
1603
+ export function getShareChannelList(params?: {
1604
+ complete?: () => void
1605
+ success?: (params: {
1606
+ /** 可分享的渠道列表 */
1607
+ shareChannelList: string[]
1608
+ }) => void
1609
+ fail?: (params: {
1610
+ errorMsg: string
1611
+ errorCode: string | number
1612
+ innerError: {
1613
+ errorCode: string | number
1614
+ errorMsg: string
1615
+ }
1616
+ }) => void
1617
+ }): void
1618
+
1619
+ /**
1620
+ * 显示分享弹窗
1621
+ */
1622
+ export function showSharePanel(params: {
1623
+ /** 分享内容类型 */
1624
+ contentType: number
1625
+ complete?: () => void
1626
+ success?: (params: {
1627
+ /** 分享平台类型 */
1628
+ platformType: string
1629
+ /** 选中平台是否安装 */
1630
+ installed: boolean
1631
+ }) => void
780
1632
  fail?: (params: {
781
1633
  errorMsg: string
782
1634
  errorCode: string | number
@@ -788,13 +1640,21 @@ declare namespace ty {
788
1640
  }): void
789
1641
 
790
1642
  /**
791
- * 获取可分享的渠道列表
1643
+ * 直接分享
792
1644
  */
793
- export function getShareChannelList(params?: {
1645
+ export function shareDirectly(params: {
1646
+ /** 分享平台类型 */
1647
+ platformType: string
1648
+ /** 相册内容标识 */
1649
+ localIdentifier: string
1650
+ /** 分享内容类型 */
1651
+ contentType: number
794
1652
  complete?: () => void
795
1653
  success?: (params: {
796
- /** 可分享的渠道列表 */
797
- shareChannelList: string[]
1654
+ /** 分享结果码 */
1655
+ code: number
1656
+ /** 分享结果描述 */
1657
+ msg: string
798
1658
  }) => void
799
1659
  fail?: (params: {
800
1660
  errorMsg: string
@@ -988,6 +1848,194 @@ declare namespace ty {
988
1848
  }) => void
989
1849
  }): void
990
1850
 
1851
+ /**
1852
+ * 截图
1853
+ */
1854
+ export function takeScreenShot(params?: {
1855
+ complete?: () => void
1856
+ success?: (params: {
1857
+ /**
1858
+ * 截图本地地址
1859
+ * path 图片路径
1860
+ */
1861
+ path: string
1862
+ }) => void
1863
+ fail?: (params: {
1864
+ errorMsg: string
1865
+ errorCode: string | number
1866
+ innerError: {
1867
+ errorCode: string | number
1868
+ errorMsg: string
1869
+ }
1870
+ }) => void
1871
+ }): void
1872
+
1873
+ /**
1874
+ * 获取websocket的连接状态
1875
+ */
1876
+ export function getWebSocketStatus(params?: {
1877
+ complete?: () => void
1878
+ success?: (params: {
1879
+ /** 0.未初始化 1. 连接中 2. 连接成功 3. 连接失败 ', */
1880
+ status: number
1881
+ }) => void
1882
+ fail?: (params: {
1883
+ errorMsg: string
1884
+ errorCode: string | number
1885
+ innerError: {
1886
+ errorCode: string | number
1887
+ errorMsg: string
1888
+ }
1889
+ }) => void
1890
+ }): void
1891
+
1892
+ /**
1893
+ * 获取websocket的连接状态
1894
+ */
1895
+ export function getWebSocketStatusSync(): {
1896
+ /** 0.未初始化 1. 连接中 2. 连接成功 3. 连接失败 ', */
1897
+ status: number
1898
+ }
1899
+
1900
+ /**
1901
+ * 绑定微信
1902
+ */
1903
+ export function bindWechat(params?: {
1904
+ complete?: () => void
1905
+ success?: (params: null) => void
1906
+ fail?: (params: {
1907
+ errorMsg: string
1908
+ errorCode: string | number
1909
+ innerError: {
1910
+ errorCode: string | number
1911
+ errorMsg: string
1912
+ }
1913
+ }) => void
1914
+ }): void
1915
+
1916
+ /**
1917
+ * 是否支持微信绑定
1918
+ */
1919
+ export function isSupportWechat(params?: {
1920
+ complete?: () => void
1921
+ success?: (params: {
1922
+ /** 是否支持微信绑定 */
1923
+ isSupport: boolean
1924
+ }) => void
1925
+ fail?: (params: {
1926
+ errorMsg: string
1927
+ errorCode: string | number
1928
+ innerError: {
1929
+ errorCode: string | number
1930
+ errorMsg: string
1931
+ }
1932
+ }) => void
1933
+ }): void
1934
+
1935
+ /**
1936
+ * 跳转微信小程序
1937
+ */
1938
+ export function gotoWechatMiniApp(params: {
1939
+ /** 小程序原始 appId */
1940
+ miniAppId: string
1941
+ /** 小程序路径 */
1942
+ path: string
1943
+ /**
1944
+ * mini program Type:
1945
+ * 0: 正式版 MINIPTOGRAM_TYPE_RELEASE
1946
+ * 1: 测试版 MINIPROGRAM_TYPE_TEST
1947
+ * 2: 预览版 MINIPROGRAM_TYPE_PREVIEW
1948
+ */
1949
+ miniProgramType: number
1950
+ complete?: () => void
1951
+ success?: (params: null) => void
1952
+ fail?: (params: {
1953
+ errorMsg: string
1954
+ errorCode: string | number
1955
+ innerError: {
1956
+ errorCode: string | number
1957
+ errorMsg: string
1958
+ }
1959
+ }) => void
1960
+ }): void
1961
+
1962
+ /**
1963
+ * 是否正在通话中
1964
+ */
1965
+ export function isCalling(params?: {
1966
+ complete?: () => void
1967
+ success?: (params: {
1968
+ /** 结果 */
1969
+ result: boolean
1970
+ }) => void
1971
+ fail?: (params: {
1972
+ errorMsg: string
1973
+ errorCode: string | number
1974
+ innerError: {
1975
+ errorCode: string | number
1976
+ errorMsg: string
1977
+ }
1978
+ }) => void
1979
+ }): void
1980
+
1981
+ /**
1982
+ * 是否正在通话中
1983
+ */
1984
+ export function canLaunchCall(params?: {
1985
+ complete?: () => void
1986
+ success?: (params: {
1987
+ /** 结果 */
1988
+ result: boolean
1989
+ }) => void
1990
+ fail?: (params: {
1991
+ errorMsg: string
1992
+ errorCode: string | number
1993
+ innerError: {
1994
+ errorCode: string | number
1995
+ errorMsg: string
1996
+ }
1997
+ }) => void
1998
+ }): void
1999
+
2000
+ /**
2001
+ * 发起呼叫
2002
+ */
2003
+ export function launchCall(params: {
2004
+ /** 设备id */
2005
+ targetId: string
2006
+ /**
2007
+ * 超时时间,单位秒
2008
+ * note: 不要传时间戳
2009
+ */
2010
+ timeout: number
2011
+ /** 通话业务参数 例如linux中控 {"channelType": 1, "category": "dgnzk"} */
2012
+ extra: Record<string, any>
2013
+ complete?: () => void
2014
+ success?: (params: null) => void
2015
+ fail?: (params: {
2016
+ errorMsg: string
2017
+ errorCode: string | number
2018
+ innerError: {
2019
+ errorCode: string | number
2020
+ errorMsg: string
2021
+ }
2022
+ }) => void
2023
+ }): void
2024
+
2025
+ /**
2026
+ * 添加消息监听
2027
+ */
2028
+ export function onAIAssistantChange(
2029
+ listener: (params: ReceiveBean) => void
2030
+ ): void
2031
+
2032
+ /**
2033
+ * 取消监听:添加消息监听
2034
+ */
2035
+ export function offAIAssistantChange(
2036
+ listener: (params: ReceiveBean) => void
2037
+ ): void
2038
+
991
2039
  /**
992
2040
  * 国家列表界面选择的国家信息
993
2041
  */
@@ -1005,32 +2053,70 @@ declare namespace ty {
1005
2053
  /**
1006
2054
  * 上传进度回调
1007
2055
  */
1008
- export function onUploadProgressUpdate(listener: (params: ProgressEvent) => void): void
2056
+ export function onUploadProgressUpdate(
2057
+ listener: (params: ProgressEvent) => void
2058
+ ): void
1009
2059
 
1010
2060
  /**
1011
2061
  * 取消监听:上传进度回调
1012
2062
  */
1013
- export function offUploadProgressUpdate(listener: (params: ProgressEvent) => void): void
2063
+ export function offUploadProgressUpdate(
2064
+ listener: (params: ProgressEvent) => void
2065
+ ): void
2066
+
2067
+ /**
2068
+ * 页面刷新事件
2069
+ */
2070
+ export function onPageRefresh(listener: (params: RefreshParams) => void): void
2071
+
2072
+ /**
2073
+ * 取消监听:页面刷新事件
2074
+ */
2075
+ export function offPageRefresh(
2076
+ listener: (params: RefreshParams) => void
2077
+ ): void
1014
2078
 
1015
2079
  /**
1016
2080
  * 事件通道响应
1017
2081
  */
1018
- export function onReceiveMessage(listener: (params: EventChannelMessageParams) => void): void
2082
+ export function onReceiveMessage(
2083
+ listener: (params: EventChannelMessageParams) => void
2084
+ ): void
1019
2085
 
1020
2086
  /**
1021
2087
  * 取消监听:事件通道响应
1022
2088
  */
1023
- export function offReceiveMessage(listener: (params: EventChannelMessageParams) => void): void
2089
+ export function offReceiveMessage(
2090
+ listener: (params: EventChannelMessageParams) => void
2091
+ ): void
1024
2092
 
1025
2093
  /**
1026
2094
  * 订单状态监听, 只有在addOrderStatusListener之后, 才能收到监听
1027
2095
  */
1028
- export function onOrderStatusListener(listener: (params: OrderStatusEvent) => void): void
2096
+ export function onOrderStatusListener(
2097
+ listener: (params: OrderStatusEvent) => void
2098
+ ): void
1029
2099
 
1030
2100
  /**
1031
2101
  * 取消监听:订单状态监听, 只有在addOrderStatusListener之后, 才能收到监听
1032
2102
  */
1033
- export function offOrderStatusListener(listener: (params: OrderStatusEvent) => void): void
2103
+ export function offOrderStatusListener(
2104
+ listener: (params: OrderStatusEvent) => void
2105
+ ): void
2106
+
2107
+ /**
2108
+ * 用户自选备选结算监听, 只有在addOrderStatusListener之后, 才能收到监听
2109
+ */
2110
+ export function onUserSelectedAlternativeBilling(
2111
+ listener: (params: UserSelectedAlternativeEvent) => void
2112
+ ): void
2113
+
2114
+ /**
2115
+ * 取消监听:用户自选备选结算监听, 只有在addOrderStatusListener之后, 才能收到监听
2116
+ */
2117
+ export function offUserSelectedAlternativeBilling(
2118
+ listener: (params: UserSelectedAlternativeEvent) => void
2119
+ ): void
1034
2120
 
1035
2121
  /**
1036
2122
  * 统一路由事件通知
@@ -1045,12 +2131,107 @@ declare namespace ty {
1045
2131
  /**
1046
2132
  * 万能路由界面返回的数据
1047
2133
  */
1048
- export function onRouterResult(listener: (params: RouterResultResponse) => void): void
2134
+ export function onRouterResult(
2135
+ listener: (params: RouterResultResponse) => void
2136
+ ): void
1049
2137
 
1050
2138
  /**
1051
2139
  * 取消监听:万能路由界面返回的数据
1052
2140
  */
1053
- export function offRouterResult(listener: (params: RouterResultResponse) => void): void
2141
+ export function offRouterResult(
2142
+ listener: (params: RouterResultResponse) => void
2143
+ ): void
2144
+
2145
+ /**
2146
+ * RN或小程序页面关闭事件(Android独有)
2147
+ */
2148
+ export function onFrontPageClose(
2149
+ listener: (params: PageCloseResponse) => void
2150
+ ): void
2151
+
2152
+ /**
2153
+ * 取消监听:RN或小程序页面关闭事件(Android独有)
2154
+ */
2155
+ export function offFrontPageClose(
2156
+ listener: (params: PageCloseResponse) => void
2157
+ ): void
2158
+
2159
+ /**
2160
+ * onWebSocketStatusChange 接受消息
2161
+ */
2162
+ export function onWebSocketStatusChange(
2163
+ listener: (params: StatusBean) => void
2164
+ ): void
2165
+
2166
+ /**
2167
+ * 取消监听:onWebSocketStatusChange 接受消息
2168
+ */
2169
+ export function offWebSocketStatusChange(
2170
+ listener: (params: StatusBean) => void
2171
+ ): void
2172
+
2173
+ export type GroupHistoryResItem = {
2174
+ /** 主键,消息标识 */
2175
+ primaryId: number
2176
+ /** 单条消息标识 */
2177
+ requestId: string
2178
+ /** 消息来源 1. 发送 2. 接收 */
2179
+ source: number
2180
+ /** 发送码 */
2181
+ code: string
2182
+ /** 错误信息 */
2183
+ message: string
2184
+ /** 类型,和发送时候type一致,以_Finish结尾 */
2185
+ type: string
2186
+ /** 创建时间 */
2187
+ createTime: number
2188
+ /** 家庭ID */
2189
+ homeId: string
2190
+ /** 渠道 */
2191
+ channel: string
2192
+ /** 会话 */
2193
+ session: string
2194
+ /** 发送/接收ws 时候携带数据 */
2195
+ options: string
2196
+ /** 数据内容 */
2197
+ data: string
2198
+ }
2199
+
2200
+ export enum HighwayMethod {
2201
+ /** HTTP 请求 GET */
2202
+ GET = "GET",
2203
+
2204
+ /** HTTP 请求 POST */
2205
+ POST = "POST",
2206
+
2207
+ /** HTTP 请求 PUT */
2208
+ PUT = "PUT",
2209
+
2210
+ /** HTTP 请求 DELETE */
2211
+ DELETE = "DELETE",
2212
+ }
2213
+
2214
+ export type ThirdPartyServiceInfo = {
2215
+ /** 服务是否可用 */
2216
+ available: boolean
2217
+ /** app是否已经安装 */
2218
+ isAppInstalled: boolean
2219
+ /** app安装连接 */
2220
+ appInstallUrl: string
2221
+ /** 三方服务类型 ThirdPartyType */
2222
+ type: number
2223
+ }
2224
+
2225
+ export type AppTabInfo = {
2226
+ /** tab的唯一标志符 */
2227
+ key: string
2228
+ /** tab的文案 */
2229
+ text: string
2230
+ /** tab的icon */
2231
+ iconPath: string
2232
+ /** tab的选中icon */
2233
+ selectedIconPath: string
2234
+ }
1054
2235
 
1055
2236
  export type PanelUiInfoBean = {
1056
2237
  /** phase 面板phase */
@@ -1097,6 +2278,13 @@ declare namespace ty {
1097
2278
  uiPhase?: string
1098
2279
  }
1099
2280
 
2281
+ export type ThirdAppBean = {
2282
+ /** an RFC 2396-compliant, encoded URI */
2283
+ uriString: string
2284
+ /** The name of the application package to handle the intent, or null to allow any application package. */
2285
+ packageName: string
2286
+ }
2287
+
1100
2288
  export type TimeConfig = {
1101
2289
  /** background */
1102
2290
  background: string
@@ -1117,6 +2305,11 @@ declare namespace ty {
1117
2305
  webPageUrl: string
1118
2306
  }
1119
2307
 
2308
+ export type ReceiveBean = {
2309
+ /** 消息内容 */
2310
+ data: string
2311
+ }
2312
+
1120
2313
  export type CountrySelectResultResponse = {
1121
2314
  /** 国家码 */
1122
2315
  countryCode?: string
@@ -1133,6 +2326,13 @@ declare namespace ty {
1133
2326
  progress: number
1134
2327
  }
1135
2328
 
2329
+ export type RefreshParams = {
2330
+ /** 关键词 */
2331
+ key: string
2332
+ /** 业务参数 */
2333
+ data?: Record<string, {}>
2334
+ }
2335
+
1136
2336
  export type EventChannelMessageParams = {
1137
2337
  /** 事件id */
1138
2338
  eventId: string
@@ -1156,6 +2356,13 @@ declare namespace ty {
1156
2356
  errorMsg?: string
1157
2357
  }
1158
2358
 
2359
+ export type UserSelectedAlternativeEvent = {
2360
+ /** google支付下,在支持备选结算系统的情况下,用户选择备选结算方式,需要携带相关toke信息,后续完成支付以后,报告云端。 */
2361
+ externalTransactionToken?: string
2362
+ /** google支付下,在支持备选结算系统的情况下,用户选择备选结算方式,需要携带相关products信息。 */
2363
+ products?: string
2364
+ }
2365
+
1159
2366
  export type RouterEvent = {
1160
2367
  /** 业务事件名称,例如设备定时更新onDeviceAlarmUpdate */
1161
2368
  bizEventName: string
@@ -1163,11 +2370,78 @@ declare namespace ty {
1163
2370
  bizEventData: Object
1164
2371
  }
1165
2372
 
1166
- export type RouterResultResponse = {
1167
- /** 路由链接 */
1168
- url: string
1169
- /** 路由调整之后返回的数据 */
1170
- data?: string
2373
+ export type RouterResultResponse = {
2374
+ /** 路由链接 */
2375
+ url: string
2376
+ /** 路由调整之后返回的数据 */
2377
+ data?: string
2378
+ }
2379
+
2380
+ export type PageCloseResponse = {
2381
+ /** 来源 */
2382
+ from?: string
2383
+ }
2384
+
2385
+ export type StatusBean = {
2386
+ /** 0.未初始化 1. 连接中 2. 连接成功 3. 连接失败 ', */
2387
+ status: number
2388
+ }
2389
+
2390
+ export type ApiRequestByAtopParams = {
2391
+ /**
2392
+ * atop入参数据模型
2393
+ * api api名称
2394
+ */
2395
+ api: string
2396
+ /** version api版本号 */
2397
+ version?: string
2398
+ /** postData 入参结构体 */
2399
+ postData: Record<string, any>
2400
+ /**
2401
+ * extData 额外参数,当前只支持传递gid
2402
+ * 数据格式:{"gid":"xxxx"}
2403
+ */
2404
+ extData?: Record<string, any>
2405
+ }
2406
+
2407
+ export type ApiRequestByAtopResponse = {
2408
+ /**
2409
+ * 请求结果
2410
+ * thing_data_ 出参结构体, JSON序列化
2411
+ */
2412
+ thing_json_?: {}
2413
+ /** 元数据 */
2414
+ data: string
2415
+ }
2416
+
2417
+ export type HighwayReq = {
2418
+ /**
2419
+ * 域名
2420
+ */
2421
+ host?: string
2422
+ /**
2423
+ * 请求API, 严格遵循restful标准格式,"/"开头
2424
+ * e.g. /v1.0/m/thing/test/path/to/my/api
2425
+ */
2426
+ api: string
2427
+ /**
2428
+ * 数据不会被加密,以 HEADER 形式传递
2429
+ * 每一个request都包含了默认的公共参数,header会覆盖默认的公共参数
2430
+ */
2431
+ header?: Record<string, any>
2432
+ /** 数据会被加密,最终以 QUERY 形式传递 */
2433
+ query?: Record<string, any>
2434
+ /** 只针对 POST 请求,数据会被加密,最终以 BODY 形式传递 */
2435
+ body?: Record<string, any>
2436
+ /** http请求方式 */
2437
+ method?: HighwayMethod
2438
+ }
2439
+
2440
+ export type HighwayResp = {
2441
+ /** 序列化返回结果 */
2442
+ result: {}
2443
+ /** apiName */
2444
+ api: string
1171
2445
  }
1172
2446
 
1173
2447
  export type EventBean = {
@@ -1188,6 +2462,50 @@ declare namespace ty {
1188
2462
  infos: Record<string, {}>
1189
2463
  }
1190
2464
 
2465
+ export type EventLinkBean = {
2466
+ /** 链路点位置,目前只支持10个链路点,0 - 9 */
2467
+ linkIndex: number
2468
+ /** 链路唯一id,保证唯一性,建议格式是:链路关键词_小程序id */
2469
+ linkId: string
2470
+ /** 业务扩展参数 map转成string */
2471
+ params: string
2472
+ }
2473
+
2474
+ export type PerformanceBean = {
2475
+ /**
2476
+ * 性能数据, 这里的数据会以点击小程序的时间为起点,到调用performance方法的时间为终点自动计算耗时
2477
+ * example: ty.performanceEvent({launchData: 'map_render_time'})
2478
+ */
2479
+ launchData?: string
2480
+ /** 业务自定义性能数据,会以key-value的形式展示在性能工具中 */
2481
+ perfData?: Record<string, string>
2482
+ }
2483
+
2484
+ export type ManagerContext = {
2485
+ /** managerId */
2486
+ managerId: number
2487
+ /** 家庭id */
2488
+ homeId: string
2489
+ /** 码率,eg:u律传8000,pcm传16000 */
2490
+ sampleRate: number
2491
+ /** 通道, eg:1 */
2492
+ channels: number
2493
+ /** 编码格式,eg:ThingAudioAsrCodeTypePCM = 0 ,ThingAudioAsrCodeTypePCMU = 1 */
2494
+ codec: string
2495
+ /** 云端asr解析选项, 注意不要设置其他跟文本无关的参数,本检测只会处理跟文本相关的数据,nlp,skill,tts不包含。 */
2496
+ options: string
2497
+ }
2498
+
2499
+ export type AsrManagerContext = {
2500
+ /** managerId */
2501
+ managerId: number
2502
+ }
2503
+
2504
+ export type Active = {
2505
+ /** 状态 */
2506
+ isActive: boolean
2507
+ }
2508
+
1191
2509
  export type AppInfoBean = {
1192
2510
  /**
1193
2511
  * App信息
@@ -1219,6 +2537,8 @@ declare namespace ty {
1219
2537
  appScheme: string
1220
2538
  /** app id */
1221
2539
  appId: string
2540
+ /** app clientId */
2541
+ clientId?: string
1222
2542
  }
1223
2543
 
1224
2544
  export type SystemWirelessInfoBean = {
@@ -1226,6 +2546,56 @@ declare namespace ty {
1226
2546
  ssId: string
1227
2547
  }
1228
2548
 
2549
+ export type NGConfigParams = {
2550
+ /** ng配置的key */
2551
+ keys: string[]
2552
+ }
2553
+
2554
+ export type ConfigResponse = {
2555
+ /** ng配置 */
2556
+ config: Record<string, {}>
2557
+ }
2558
+
2559
+ export type ConfigParams = {
2560
+ /**
2561
+ * 三段式结构对应配置中心的业务配置
2562
+ * 举例:["oem:config:open_device_network"]
2563
+ */
2564
+ keys: string[]
2565
+ }
2566
+
2567
+ export type ThirdPartyServiceParams = {
2568
+ /** 三方服务列表 ThirdPartyType */
2569
+ types: number[]
2570
+ }
2571
+
2572
+ export type ThirdPartyMiniProgramParams = {
2573
+ /** 三方小程序类型 ThirdPartyMiniProgramType */
2574
+ type: number
2575
+ /** 三方小程序参数 */
2576
+ params: Record<string, {}>
2577
+ }
2578
+
2579
+ export type ThirdPartyMiniProgramResult = {
2580
+ /** 三方小程序结果 */
2581
+ data: Record<string, {}>
2582
+ }
2583
+
2584
+ export type CloudEnvResult = {
2585
+ /** 云端环境 CloudEnvType */
2586
+ env: number
2587
+ }
2588
+
2589
+ export type MiniAppAvailableRes = {
2590
+ /** 是否支持小程序环境 */
2591
+ availalble: boolean
2592
+ }
2593
+
2594
+ export type AppTabInfoResponse = {
2595
+ /** tab信息 */
2596
+ tabInfo: AppTabInfo[]
2597
+ }
2598
+
1229
2599
  export type IconfontInfoBean = {
1230
2600
  /**
1231
2601
  * iconfont 信息结构体
@@ -1234,12 +2604,51 @@ declare namespace ty {
1234
2604
  nameMap: string
1235
2605
  }
1236
2606
 
2607
+ export type PaymentParam = {
2608
+ /** 订单ID */
2609
+ orderID: string
2610
+ /** 商品ID */
2611
+ productID: string
2612
+ /** 订阅单预支付code */
2613
+ preFlowCode: string
2614
+ /** 1: 订阅 0: 非订阅 */
2615
+ subscription?: number
2616
+ /**
2617
+ * 指定订阅升级/降级期间的按比例分配模式
2618
+ * Google提供的几种模式:
2619
+ * int UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0;
2620
+ * int IMMEDIATE_WITH_TIME_PRORATION = 1;
2621
+ * int IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2;
2622
+ * int IMMEDIATE_WITHOUT_PRORATION = 3;
2623
+ * int DEFERRED = 4
2624
+ */
2625
+ billing_mode?: number
2626
+ /** 之前的sku商品,用于筛选和获取历史订单的令牌做升级处理 */
2627
+ previous_sku?: string
2628
+ }
2629
+
2630
+ export type PaymentResponse = {
2631
+ /** 订单ID */
2632
+ orderID?: string
2633
+ /** 选择订单为备选结算处理token,用于后台主动上报备选结算报告单 */
2634
+ token?: string
2635
+ /** 选择为备选结算处理的订单 */
2636
+ products?: string
2637
+ /** 0:iap 1:备选结算 */
2638
+ paymentType?: number
2639
+ }
2640
+
2641
+ export type TypeResponse = {
2642
+ /** 支付类型 0:三方支付; 1:苹果支付,2:google支付,3:google支付支持备选结算 */
2643
+ data: number
2644
+ }
2645
+
1237
2646
  export type UploadParams = {
1238
2647
  /** the file path */
1239
2648
  filePath: string
1240
2649
  /** business type, config via backend ng */
1241
2650
  bizType: string
1242
- /** file type */
2651
+ /** file type, ios necessary */
1243
2652
  contentType?: string
1244
2653
  /** polling interval of big file in second, default is 2 second */
1245
2654
  delayTime?: number
@@ -1252,6 +2661,24 @@ declare namespace ty {
1252
2661
  result: string
1253
2662
  }
1254
2663
 
2664
+ export type VideoUploadParams = {
2665
+ /** the file path */
2666
+ filePath: string
2667
+ /** business type, config via backend ng */
2668
+ bizType: string
2669
+ /** file type, ios necessary */
2670
+ contentType?: string
2671
+ }
2672
+
2673
+ export type RequestModel = {
2674
+ /** 实时通知类型 */
2675
+ activityType?: any
2676
+ /** 实时通知ID */
2677
+ activityId: string
2678
+ /** 实时通知参数 */
2679
+ data: Record<string, string>
2680
+ }
2681
+
1255
2682
  export type LocalConstants = {
1256
2683
  /** 手机当前地区语言 */
1257
2684
  langKey: string
@@ -1269,6 +2696,34 @@ declare namespace ty {
1269
2696
  langContent: {}
1270
2697
  }
1271
2698
 
2699
+ export type ManagerContext_asWhI2 = {
2700
+ /** managerId */
2701
+ managerId: number
2702
+ /** 自定义标记 */
2703
+ tag: string
2704
+ }
2705
+
2706
+ export type ManagerReqContext = {
2707
+ /** managerId */
2708
+ managerId: number
2709
+ /** 单条日志不要过10k */
2710
+ message: string
2711
+ }
2712
+
2713
+ export type NGRequestBean = {
2714
+ /** 要获取元数据的key值,支持x.y.z格式 */
2715
+ rawKey: string
2716
+ }
2717
+
2718
+ export type NGResponseBean = {
2719
+ /** 返回元数据 */
2720
+ rawData: string
2721
+ }
2722
+
2723
+ export type CustomerServiceRes = {
2724
+ url: string
2725
+ }
2726
+
1272
2727
  export type PanelBean = {
1273
2728
  /**
1274
2729
  * 跳转RN面板(优先通过deviceId跳转设备面板,panelUiInfoBean不为null,则两者组合来跳转面板)
@@ -1355,6 +2810,22 @@ declare namespace ty {
1355
2810
  eventId: string
1356
2811
  }
1357
2812
 
2813
+ export type ActivityResultBean = {
2814
+ /** The result code to propagate back to the originating activity, often RESULT_CANCELED or RESULT_OK */
2815
+ resultCode: number
2816
+ /** The data to propagate back to the originating activity. */
2817
+ data?: Record<string, {}>
2818
+ }
2819
+
2820
+ export type CanOpenThirdAppBean = {
2821
+ isCanOpen?: boolean
2822
+ }
2823
+
2824
+ export type OpenDefaultBrowserUrlBean = {
2825
+ /** 要打开的url */
2826
+ url: string
2827
+ }
2828
+
1358
2829
  export type PayInfoBean = {
1359
2830
  /**
1360
2831
  * 支付方式
@@ -1364,6 +2835,8 @@ declare namespace ty {
1364
2835
  * 2: google支付
1365
2836
  */
1366
2837
  iapType?: number
2838
+ /** google支付下是否支持用户自选的备选结算 */
2839
+ googleIapEnableUserChoice?: boolean
1367
2840
  }
1368
2841
 
1369
2842
  export type iapPayReadyReq = {
@@ -1465,7 +2938,7 @@ declare namespace ty {
1465
2938
  * miniProgram:微信小程序分享内容
1466
2939
  */
1467
2940
  contentType: string
1468
- /** recipients 邮件收件人 */
2941
+ /** recipients 邮件收件人/短信接收人 */
1469
2942
  recipients?: string[]
1470
2943
  /** imagePath 图片路径 */
1471
2944
  imagePath?: string
@@ -1482,6 +2955,34 @@ declare namespace ty {
1482
2955
  shareChannelList: string[]
1483
2956
  }
1484
2957
 
2958
+ export type SharePanelParams = {
2959
+ /** 分享内容类型 */
2960
+ contentType: number
2961
+ }
2962
+
2963
+ export type SharePanelResponse = {
2964
+ /** 分享平台类型 */
2965
+ platformType: string
2966
+ /** 选中平台是否安装 */
2967
+ installed: boolean
2968
+ }
2969
+
2970
+ export type ShareContentParams = {
2971
+ /** 分享平台类型 */
2972
+ platformType: string
2973
+ /** 相册内容标识 */
2974
+ localIdentifier: string
2975
+ /** 分享内容类型 */
2976
+ contentType: number
2977
+ }
2978
+
2979
+ export type ShareContentResponse = {
2980
+ /** 分享结果码 */
2981
+ code: number
2982
+ /** 分享结果描述 */
2983
+ msg: string
2984
+ }
2985
+
1485
2986
  export type SiriEnabledResponse = {
1486
2987
  /** 是否支持 */
1487
2988
  isSupported: boolean
@@ -1577,6 +3078,251 @@ declare namespace ty {
1577
3078
  orientation: number
1578
3079
  }
1579
3080
 
3081
+ export type ScreenShotResultBean = {
3082
+ /**
3083
+ * 截图本地地址
3084
+ * path 图片路径
3085
+ */
3086
+ path: string
3087
+ }
3088
+
3089
+ export type WechatSupport = {
3090
+ /** 是否支持微信绑定 */
3091
+ isSupport: boolean
3092
+ }
3093
+
3094
+ export type MiniApp = {
3095
+ /** 小程序原始 appId */
3096
+ miniAppId: string
3097
+ /** 小程序路径 */
3098
+ path: string
3099
+ /**
3100
+ * mini program Type:
3101
+ * 0: 正式版 MINIPTOGRAM_TYPE_RELEASE
3102
+ * 1: 测试版 MINIPROGRAM_TYPE_TEST
3103
+ * 2: 预览版 MINIPROGRAM_TYPE_PREVIEW
3104
+ */
3105
+ miniProgramType: number
3106
+ }
3107
+
3108
+ export type Result = {
3109
+ /** 结果 */
3110
+ result: boolean
3111
+ }
3112
+
3113
+ export type Call = {
3114
+ /** 设备id */
3115
+ targetId: string
3116
+ /**
3117
+ * 超时时间,单位秒
3118
+ * note: 不要传时间戳
3119
+ */
3120
+ timeout: number
3121
+ /** 通话业务参数 例如linux中控 {"channelType": 1, "category": "dgnzk"} */
3122
+ extra: Record<string, any>
3123
+ }
3124
+
3125
+ /**
3126
+ * AI语音助手管理器
3127
+ */
3128
+ interface GetAsrListenerManagerTask {
3129
+ /**
3130
+ * 状态
3131
+ */
3132
+ getAsrActive(params: {
3133
+ complete?: () => void
3134
+ success?: (params: {
3135
+ /** 状态 */
3136
+ isActive: boolean
3137
+ }) => void
3138
+ fail?: (params: {
3139
+ errorMsg: string
3140
+ errorCode: string | number
3141
+ innerError: {
3142
+ errorCode: string | number
3143
+ errorMsg: string
3144
+ }
3145
+ }) => void
3146
+ }): void
3147
+
3148
+ /**
3149
+ * 关闭麦克风,关闭后识音要等到全部识别完成才结束
3150
+ */
3151
+ stopDetect(params: {
3152
+ complete?: () => void
3153
+ success?: (params: null) => void
3154
+ fail?: (params: {
3155
+ errorMsg: string
3156
+ errorCode: string | number
3157
+ innerError: {
3158
+ errorCode: string | number
3159
+ errorMsg: string
3160
+ }
3161
+ }) => void
3162
+ }): void
3163
+
3164
+ /**
3165
+ * 关闭麦克风,关闭后识音要等到全部识别完成才结束
3166
+ */
3167
+ startDetect(params: {
3168
+ complete?: () => void
3169
+ success?: (params: null) => void
3170
+ fail?: (params: {
3171
+ errorMsg: string
3172
+ errorCode: string | number
3173
+ innerError: {
3174
+ errorCode: string | number
3175
+ errorMsg: string
3176
+ }
3177
+ }) => void
3178
+ }): void
3179
+
3180
+ /**
3181
+ * 开始监听 + 识音
3182
+ */
3183
+ onDetect(
3184
+ listener: (params: {
3185
+ /** managerId */
3186
+ managerId: number
3187
+ /** 拾音状态 0. 未开启 1.进行中 2.结束 3.发送错误 */
3188
+ state: number
3189
+ /** 语言转换内容 */
3190
+ text: string
3191
+ /** 错误码 0. 录音时间太短 */
3192
+ errorCode: number
3193
+ }) => void
3194
+ ): void
3195
+
3196
+ /**
3197
+ * 取消监听
3198
+ */
3199
+ offDetect(
3200
+ listener: (params: {
3201
+ /** managerId */
3202
+ managerId: number
3203
+ /** 拾音状态 0. 未开启 1.进行中 2.结束 3.发送错误 */
3204
+ state: number
3205
+ /** 语言转换内容 */
3206
+ text: string
3207
+ /** 错误码 0. 录音时间太短 */
3208
+ errorCode: number
3209
+ }) => void
3210
+ ): void
3211
+ }
3212
+ export function getAsrListenerManager(params: {
3213
+ /** 家庭id */
3214
+ homeId: string
3215
+ /** 码率,eg:u律传8000,pcm传16000 */
3216
+ sampleRate: number
3217
+ /** 通道, eg:1 */
3218
+ channels: number
3219
+ /** 编码格式,eg:ThingAudioAsrCodeTypePCM = 0 ,ThingAudioAsrCodeTypePCMU = 1 */
3220
+ codec: string
3221
+ /** 云端asr解析选项, 注意不要设置其他跟文本无关的参数,本检测只会处理跟文本相关的数据,nlp,skill,tts不包含。 */
3222
+ options: string
3223
+ complete?: () => void
3224
+ success?: (params: null) => void
3225
+ fail?: (params: {
3226
+ errorMsg: string
3227
+ errorCode: string | number
3228
+ innerError: {
3229
+ errorCode: string | number
3230
+ errorMsg: string
3231
+ }
3232
+ }) => void
3233
+ }): GetAsrListenerManagerTask
3234
+
3235
+ /**
3236
+ * 日志管理器
3237
+ */
3238
+ interface GetLogManagerTask {
3239
+ /**
3240
+ * log日志
3241
+ */
3242
+ log(params: {
3243
+ /** 单条日志不要过10k */
3244
+ message: string
3245
+ complete?: () => void
3246
+ success?: (params: null) => void
3247
+ fail?: (params: {
3248
+ errorMsg: string
3249
+ errorCode: string | number
3250
+ innerError: {
3251
+ errorCode: string | number
3252
+ errorMsg: string
3253
+ }
3254
+ }) => void
3255
+ }): void
3256
+
3257
+ /**
3258
+ * error日志
3259
+ */
3260
+ error(params: {
3261
+ /** 单条日志不要过10k */
3262
+ message: string
3263
+ complete?: () => void
3264
+ success?: (params: null) => void
3265
+ fail?: (params: {
3266
+ errorMsg: string
3267
+ errorCode: string | number
3268
+ innerError: {
3269
+ errorCode: string | number
3270
+ errorMsg: string
3271
+ }
3272
+ }) => void
3273
+ }): void
3274
+
3275
+ /**
3276
+ * feedback日志
3277
+ */
3278
+ feedback(params: {
3279
+ /** 单条日志不要过10k */
3280
+ message: string
3281
+ complete?: () => void
3282
+ success?: (params: null) => void
3283
+ fail?: (params: {
3284
+ errorMsg: string
3285
+ errorCode: string | number
3286
+ innerError: {
3287
+ errorCode: string | number
3288
+ errorMsg: string
3289
+ }
3290
+ }) => void
3291
+ }): void
3292
+
3293
+ /**
3294
+ * debug日志
3295
+ */
3296
+ debug(params: {
3297
+ /** 单条日志不要过10k */
3298
+ message: string
3299
+ complete?: () => void
3300
+ success?: (params: null) => void
3301
+ fail?: (params: {
3302
+ errorMsg: string
3303
+ errorCode: string | number
3304
+ innerError: {
3305
+ errorCode: string | number
3306
+ errorMsg: string
3307
+ }
3308
+ }) => void
3309
+ }): void
3310
+ }
3311
+ export function getLogManager(params: {
3312
+ /** 自定义标记 */
3313
+ tag: string
3314
+ complete?: () => void
3315
+ success?: (params: null) => void
3316
+ fail?: (params: {
3317
+ errorMsg: string
3318
+ errorCode: string | number
3319
+ innerError: {
3320
+ errorCode: string | number
3321
+ errorMsg: string
3322
+ }
3323
+ }) => void
3324
+ }): GetLogManagerTask
3325
+
1580
3326
  /**
1581
3327
  * EventChannel
1582
3328
  */