@ray-js/api 1.5.0-beta.12 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/@types/BaseKit.d.ts +246 -126
  2. package/@types/BizKit.d.ts +1 -1
  3. package/@types/MapKit.d.ts +237 -1
  4. package/@types/MiniKit.d.ts +1 -1
  5. package/@types/OutdoorKit.d.ts +232 -0
  6. package/@types/P2PKit.d.ts +24 -2
  7. package/@types/all-kits.d.ts +1 -0
  8. package/@types/api-extend.d.ts +8 -2
  9. package/@types/index.d.ts +87 -0
  10. package/lib/{BaseKit-3.3.10.d.ts → BaseKit-3.11.0.d.ts} +1 -0
  11. package/lib/{BaseKit-3.3.10.js → BaseKit-3.11.0.js} +6 -2
  12. package/lib/BizKit-3.2.7.js +2 -1
  13. package/lib/DeviceKit-3.3.1.js +2 -1
  14. package/lib/HomeKit-3.1.4.js +2 -1
  15. package/lib/{MapKit-3.0.7.d.ts → MapKit-3.4.13.d.ts} +5 -0
  16. package/lib/{MapKit-3.0.7.js → MapKit-3.4.13.js} +19 -1
  17. package/lib/MiniKit-3.1.0.js +3 -2
  18. package/lib/OutdoorKit-1.0.4.d.ts +14 -0
  19. package/lib/OutdoorKit-1.0.4.js +39 -0
  20. package/lib/P2PKit-2.0.3.d.ts +1 -0
  21. package/lib/P2PKit-2.0.3.js +5 -1
  22. package/lib/PlayNetKit-1.1.3.d.ts +24 -25
  23. package/lib/PlayNetKit-1.1.3.js +2 -1
  24. package/lib/all-kits.d.ts +3 -2
  25. package/lib/all-kits.js +3 -2
  26. package/lib/cloud/alarm.js +2 -2
  27. package/lib/cloud/core.js +1 -1
  28. package/lib/cloud/device.d.ts +25 -1
  29. package/lib/cloud/device.js +20 -6
  30. package/lib/cloud/doorlock/README.md +62 -0
  31. package/lib/cloud/doorlock/auth.d.ts +235 -0
  32. package/lib/cloud/doorlock/auth.js +223 -0
  33. package/lib/cloud/doorlock/auth.md +323 -0
  34. package/lib/cloud/doorlock/device.d.ts +137 -0
  35. package/lib/cloud/doorlock/device.js +187 -0
  36. package/lib/cloud/doorlock/device.md +265 -0
  37. package/lib/cloud/doorlock/index.d.ts +10 -0
  38. package/lib/cloud/doorlock/index.js +20 -0
  39. package/lib/cloud/doorlock/log.d.ts +113 -0
  40. package/lib/cloud/doorlock/log.js +53 -0
  41. package/lib/cloud/doorlock/log.md +153 -0
  42. package/lib/cloud/doorlock/member-opmode.d.ts +121 -0
  43. package/lib/cloud/doorlock/member-opmode.js +104 -0
  44. package/lib/cloud/doorlock/member-opmode.md +279 -0
  45. package/lib/cloud/doorlock/member.d.ts +110 -0
  46. package/lib/cloud/doorlock/member.js +72 -0
  47. package/lib/cloud/doorlock/member.md +276 -0
  48. package/lib/cloud/doorlock/offline-pwd.d.ts +61 -0
  49. package/lib/cloud/doorlock/offline-pwd.js +67 -0
  50. package/lib/cloud/doorlock/offline-pwd.md +155 -0
  51. package/lib/cloud/doorlock/old.d.ts +36 -0
  52. package/lib/cloud/doorlock/old.js +102 -0
  53. package/lib/cloud/doorlock/temp-pwd.d.ts +194 -0
  54. package/lib/cloud/doorlock/temp-pwd.js +193 -0
  55. package/lib/cloud/doorlock/temp-pwd.md +362 -0
  56. package/lib/cloud/doorlock/unlock-method.d.ts +62 -0
  57. package/lib/cloud/doorlock/unlock-method.js +85 -0
  58. package/lib/cloud/doorlock/unlock-method.md +121 -0
  59. package/lib/cloud/doorlock/unlock.d.ts +89 -0
  60. package/lib/cloud/doorlock/unlock.js +76 -0
  61. package/lib/cloud/doorlock/unlock.md +222 -0
  62. package/lib/cloud/index.d.ts +4 -0
  63. package/lib/cloud/index.js +10 -1
  64. package/lib/cloud/interface.d.ts +39 -2
  65. package/lib/cloud/linkage.d.ts +8 -5
  66. package/lib/cloud/linkage.js +38 -17
  67. package/lib/cloud/outdoor.d.ts +15 -0
  68. package/lib/cloud/outdoor.js +25 -0
  69. package/lib/cloud/recipe/README.md +36 -0
  70. package/lib/cloud/recipe/basket.d.ts +220 -0
  71. package/lib/cloud/recipe/basket.js +328 -0
  72. package/lib/cloud/recipe/basket.md +431 -0
  73. package/lib/cloud/recipe/category-list.d.ts +71 -0
  74. package/lib/cloud/recipe/category-list.js +65 -0
  75. package/lib/cloud/recipe/category-list.md +132 -0
  76. package/lib/cloud/recipe/custom.d.ts +177 -0
  77. package/lib/cloud/recipe/custom.js +171 -0
  78. package/lib/cloud/recipe/custom.md +265 -0
  79. package/lib/cloud/recipe/index.d.ts +8 -0
  80. package/lib/cloud/recipe/index.js +8 -0
  81. package/lib/cloud/recipe/menu.d.ts +170 -0
  82. package/lib/cloud/recipe/menu.js +76 -0
  83. package/lib/cloud/recipe/menu.md +276 -0
  84. package/lib/cloud/recipe/query.d.ts +87 -0
  85. package/lib/cloud/recipe/query.js +101 -0
  86. package/lib/cloud/recipe/query.md +112 -0
  87. package/lib/cloud/recipe/record.d.ts +54 -0
  88. package/lib/cloud/recipe/record.js +87 -0
  89. package/lib/cloud/recipe/record.md +115 -0
  90. package/lib/cloud/recipe/score.d.ts +69 -0
  91. package/lib/cloud/recipe/score.js +106 -0
  92. package/lib/cloud/recipe/score.md +112 -0
  93. package/lib/cloud/recipe/star.d.ts +131 -0
  94. package/lib/cloud/recipe/star.js +151 -0
  95. package/lib/cloud/recipe/star.md +196 -0
  96. package/lib/cloud/recipe/types.d.ts +7 -0
  97. package/lib/cloud/recipe/types.js +0 -0
  98. package/lib/cloud/remoteGroup.d.ts +10 -0
  99. package/lib/cloud/remoteGroup.js +31 -0
  100. package/lib/cloud/statistic.js +9 -9
  101. package/lib/cloud/timer.js +14 -14
  102. package/lib/constants.js +1 -1
  103. package/lib/errorCode.d.ts +4 -0
  104. package/lib/errorCode.js +3 -0
  105. package/lib/getCdnUrl/index.d.ts +2 -2
  106. package/lib/getCdnUrl/index.js +1 -2
  107. package/lib/getCdnUrl/index.wechat.d.ts +2 -2
  108. package/lib/getCdnUrl/index.wechat.js +1 -2
  109. package/lib/getElementById/index.thing.js +1 -1
  110. package/lib/getElementById/index.wechat.js +1 -1
  111. package/lib/index.d.ts +1 -0
  112. package/lib/index.js +1 -0
  113. package/lib/nativeRouters/common.d.ts +15 -0
  114. package/lib/nativeRouters/common.js +38 -0
  115. package/lib/nativeRouters/device.d.ts +59 -0
  116. package/lib/nativeRouters/device.js +69 -0
  117. package/lib/nativeRouters/gw.d.ts +23 -0
  118. package/lib/nativeRouters/gw.js +27 -0
  119. package/lib/nativeRouters/index.d.ts +6 -1
  120. package/lib/nativeRouters/index.js +6 -1
  121. package/lib/nativeRouters/ipc.d.ts +30 -0
  122. package/lib/nativeRouters/ipc.js +44 -0
  123. package/lib/nativeRouters/outdoors.d.ts +47 -0
  124. package/lib/nativeRouters/outdoors.js +41 -0
  125. package/lib/nativeRouters/remoteGroup.d.ts +22 -0
  126. package/lib/nativeRouters/remoteGroup.js +11 -0
  127. package/lib/nativeRouters/root.d.ts +41 -0
  128. package/lib/nativeRouters/root.js +53 -0
  129. package/lib/openGroupCreate/index.js +3 -3
  130. package/lib/panel/i18n/index.d.ts +7 -6
  131. package/lib/panel/i18n/index.js +39 -23
  132. package/lib/panel/i18n/index.wechat.js +13 -12
  133. package/lib/panel/normalizeNetwork.js +1 -1
  134. package/lib/panel/publishDps.js +1 -1
  135. package/lib/redirectTo/index.js +1 -0
  136. package/lib/utils.d.ts +5 -2
  137. package/lib/utils.js +46 -20
  138. package/lib/utils.wechat.d.ts +3 -0
  139. package/lib/utils.wechat.js +22 -6
  140. package/lib/viewAPI.d.ts +1 -0
  141. package/lib/viewAPI.js +4 -3
  142. package/package.json +8 -7
  143. package/@types/PlayNetKit.d.ts +0 -444
  144. package/lib/nativeRouters/scene.d.ts +0 -34
  145. package/lib/nativeRouters/scene.js +0 -60
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * MapKit
3
3
  *
4
- * @version 3.0.7
4
+ * @version 3.4.13
5
5
  */
6
6
  declare namespace ty.map {
7
7
  /**
@@ -181,6 +181,16 @@ declare namespace ty.map {
181
181
  streetName: string
182
182
  /** 位置名称 */
183
183
  address: string
184
+ /** 国家码 */
185
+ countryCode: string
186
+ /** 邮编 */
187
+ postalCode: string
188
+ /** 国家名 */
189
+ countryName: string
190
+ /** 省名 */
191
+ province: string
192
+ /** 区名, 次级区域名 */
193
+ district: string
184
194
  }) => void
185
195
  fail?: (params: {
186
196
  errorMsg: string
@@ -266,6 +276,167 @@ declare namespace ty.map {
266
276
  }) => void
267
277
  }): void
268
278
 
279
+ /**
280
+ * 根据经纬度或者地址
281
+ */
282
+ export function transformLocation(params: {
283
+ /** wgs84 返回 gps 坐标,gcj02 返回可用于 openLocation 的坐标 */
284
+ type: string
285
+ /** 纬度,范围为 -90~90,负数表示南纬 */
286
+ latitude: number
287
+ /** 经度,范围为 -180~180,负数表示西经 */
288
+ longitude: number
289
+ complete?: () => void
290
+ success?: (params: {
291
+ /** 纬度,范围为 -90~90,负数表示南纬 */
292
+ latitude: number
293
+ /** 经度,范围为 -180~180,负数表示西经 */
294
+ longitude: number
295
+ /** 城市名称street */
296
+ cityName: string
297
+ /** 街道名称 */
298
+ streetName: string
299
+ /** 位置名称 */
300
+ address: string
301
+ /** 国家码 */
302
+ countryCode: string
303
+ /** 邮编 */
304
+ postalCode: string
305
+ /** 国家名 */
306
+ countryName: string
307
+ /** 省名 */
308
+ province: string
309
+ /** 区名, 次级区域名 */
310
+ district: string
311
+ }) => void
312
+ fail?: (params: {
313
+ errorMsg: string
314
+ errorCode: string | number
315
+ innerError: {
316
+ errorCode: string | number
317
+ errorMsg: string
318
+ }
319
+ }) => void
320
+ }): void
321
+
322
+ /**
323
+ * 将经纬度转换为具体的地址
324
+ */
325
+ export function reverseGeocodeLocation(params: {
326
+ /** 经度 */
327
+ longitude: number
328
+ /** 纬度 */
329
+ latitude: number
330
+ /** 请求的经纬度类型,wgs84 返回 gps 坐标,gcj02 返回可用于 openLocation 的坐标,默认为 wgs84 */
331
+ requestType?: string
332
+ /** 响应的经纬度类型,wgs84 返回 gps 坐标,gcj02 返回可用于 openLocation 的坐标,默认为 wgs84 */
333
+ responseType?: string
334
+ complete?: () => void
335
+ success?: (params: {
336
+ /** 纬度,范围为 -90~90,负数表示南纬 */
337
+ latitude: number
338
+ /** 经度,范围为 -180~180,负数表示西经 */
339
+ longitude: number
340
+ /** 城市名称street */
341
+ cityName: string
342
+ /** 街道名称 */
343
+ streetName: string
344
+ /** 位置名称 */
345
+ address: string
346
+ /** 国家码 */
347
+ countryCode: string
348
+ /** 邮编 */
349
+ postalCode: string
350
+ /** 国家名 */
351
+ countryName: string
352
+ /** 省名 */
353
+ province: string
354
+ /** 区名, 次级区域名 */
355
+ district: string
356
+ }) => void
357
+ fail?: (params: {
358
+ errorMsg: string
359
+ errorCode: string | number
360
+ innerError: {
361
+ errorCode: string | number
362
+ errorMsg: string
363
+ }
364
+ }) => void
365
+ }): void
366
+
367
+ /**
368
+ * 将WGS84坐标系转为GCJ02坐标系
369
+ */
370
+ export function coordinateWGS84ToGCJ02(params: {
371
+ /** 经度 */
372
+ longitude: number
373
+ /** 纬度 */
374
+ latitude: number
375
+ complete?: () => void
376
+ success?: (params: {
377
+ /** 经度 */
378
+ longitude: number
379
+ /** 纬度 */
380
+ latitude: number
381
+ }) => void
382
+ fail?: (params: {
383
+ errorMsg: string
384
+ errorCode: string | number
385
+ innerError: {
386
+ errorCode: string | number
387
+ errorMsg: string
388
+ }
389
+ }) => void
390
+ }): void
391
+
392
+ /**
393
+ * 将GCJ02坐标系转为WGS84坐标系
394
+ */
395
+ export function coordinateGCJ02ToWGS84(params: {
396
+ /** 经度 */
397
+ longitude: number
398
+ /** 纬度 */
399
+ latitude: number
400
+ complete?: () => void
401
+ success?: (params: {
402
+ /** 经度 */
403
+ longitude: number
404
+ /** 纬度 */
405
+ latitude: number
406
+ }) => void
407
+ fail?: (params: {
408
+ errorMsg: string
409
+ errorCode: string | number
410
+ innerError: {
411
+ errorCode: string | number
412
+ errorMsg: string
413
+ }
414
+ }) => void
415
+ }): void
416
+
417
+ /**
418
+ * 获取当前地图类型
419
+ *huawei: 华为地图
420
+ *google: 谷歌地图
421
+ *amap: 高德地图
422
+ *apple: 苹果地图
423
+ */
424
+ export function getMapType(params?: {
425
+ complete?: () => void
426
+ success?: (params: {
427
+ /** 地图类型 */
428
+ type: string
429
+ }) => void
430
+ fail?: (params: {
431
+ errorMsg: string
432
+ errorCode: string | number
433
+ innerError: {
434
+ errorCode: string | number
435
+ errorMsg: string
436
+ }
437
+ }) => void
438
+ }): void
439
+
269
440
  export type GeofenceInfo = {
270
441
  /** 地理围栏名称 */
271
442
  geoTitle?: string
@@ -334,6 +505,16 @@ declare namespace ty.map {
334
505
  streetName: string
335
506
  /** 位置名称 */
336
507
  address: string
508
+ /** 国家码 */
509
+ countryCode: string
510
+ /** 邮编 */
511
+ postalCode: string
512
+ /** 国家名 */
513
+ countryName: string
514
+ /** 省名 */
515
+ province: string
516
+ /** 区名, 次级区域名 */
517
+ district: string
337
518
  }
338
519
 
339
520
  export type ChooseBean = {
@@ -371,4 +552,59 @@ declare namespace ty.map {
371
552
  /** 地图类型,目前支持:BMK:百度地图 MA:高德地图 TENCENT:腾讯地图 Google:Google地图 */
372
553
  mapType: string
373
554
  }
555
+
556
+ export type TransformLocationReq = {
557
+ /** wgs84 返回 gps 坐标,gcj02 返回可用于 openLocation 的坐标 */
558
+ type: string
559
+ /** 纬度,范围为 -90~90,负数表示南纬 */
560
+ latitude: number
561
+ /** 经度,范围为 -180~180,负数表示西经 */
562
+ longitude: number
563
+ }
564
+
565
+ export type TransformLocationResp = {
566
+ /** 纬度,范围为 -90~90,负数表示南纬 */
567
+ latitude: number
568
+ /** 经度,范围为 -180~180,负数表示西经 */
569
+ longitude: number
570
+ /** 城市名称street */
571
+ cityName: string
572
+ /** 街道名称 */
573
+ streetName: string
574
+ /** 位置名称 */
575
+ address: string
576
+ /** 国家码 */
577
+ countryCode: string
578
+ /** 邮编 */
579
+ postalCode: string
580
+ /** 国家名 */
581
+ countryName: string
582
+ /** 省名 */
583
+ province: string
584
+ /** 区名, 次级区域名 */
585
+ district: string
586
+ }
587
+
588
+ export type ReverseGeocodeLocationReq = {
589
+ /** 经度 */
590
+ longitude: number
591
+ /** 纬度 */
592
+ latitude: number
593
+ /** 请求的经纬度类型,wgs84 返回 gps 坐标,gcj02 返回可用于 openLocation 的坐标,默认为 wgs84 */
594
+ requestType?: string
595
+ /** 响应的经纬度类型,wgs84 返回 gps 坐标,gcj02 返回可用于 openLocation 的坐标,默认为 wgs84 */
596
+ responseType?: string
597
+ }
598
+
599
+ export type Coordinate = {
600
+ /** 经度 */
601
+ longitude: number
602
+ /** 纬度 */
603
+ latitude: number
604
+ }
605
+
606
+ export type MapTypeBean = {
607
+ /** 地图类型 */
608
+ type: string
609
+ }
374
610
  }
@@ -991,7 +991,7 @@ declare namespace ty {
991
991
  /** 当前版本是否可用 */
992
992
  result: boolean
993
993
  }) => void
994
- failure?: (params: {
994
+ fail?: (params: {
995
995
  errorMsg: string
996
996
  errorCode: string | number
997
997
  innerError: {
@@ -0,0 +1,232 @@
1
+ /**
2
+ * OutdoorKit
3
+ *
4
+ * @version 1.0.4
5
+ */
6
+ declare namespace ty.outdoor {
7
+ /**
8
+ * 出行获取当前首页展示的设备ID
9
+ */
10
+ export function currentDevice(params?: {
11
+ complete?: () => void
12
+ success?: (params: {
13
+ /** deviceID 设备ID */
14
+ deviceID: string
15
+ }) => void
16
+ fail?: (params: {
17
+ errorMsg: string
18
+ errorCode: string | number
19
+ innerError: {
20
+ errorCode: string | number
21
+ errorMsg: string
22
+ }
23
+ }) => void
24
+ }): void
25
+
26
+ /**
27
+ * 切换设备,会弹出Native切换选择器
28
+ */
29
+ export function switchDevice(params?: {
30
+ complete?: () => void
31
+ success?: (params: boolean) => void
32
+ fail?: (params: {
33
+ errorMsg: string
34
+ errorCode: string | number
35
+ innerError: {
36
+ errorCode: string | number
37
+ errorMsg: string
38
+ }
39
+ }) => void
40
+ }): void
41
+
42
+ /**
43
+ * 获取已绑定设备ID集合
44
+ */
45
+ export function getBoundDeviceIdList(params?: {
46
+ complete?: () => void
47
+ success?: (params: {
48
+ /** 返回已绑定的设备ID集合 */
49
+ devIdList: string[]
50
+ }) => void
51
+ fail?: (params: {
52
+ errorMsg: string
53
+ errorCode: string | number
54
+ innerError: {
55
+ errorCode: string | number
56
+ errorMsg: string
57
+ }
58
+ }) => void
59
+ }): void
60
+
61
+ /**
62
+ * 获取可绑定设备ID集合
63
+ */
64
+ export function getUnbindDeviceIdList(params?: {
65
+ complete?: () => void
66
+ success?: (params: {
67
+ /** 返回可绑定的设备ID集合 */
68
+ devIdList: string[]
69
+ }) => void
70
+ fail?: (params: {
71
+ errorMsg: string
72
+ errorCode: string | number
73
+ innerError: {
74
+ errorCode: string | number
75
+ errorMsg: string
76
+ }
77
+ }) => void
78
+ }): void
79
+
80
+ /**
81
+ * 从设备绑定
82
+ */
83
+ export function bindSlaveDevice(params: {
84
+ /** 从设备ID */
85
+ slaveDevId: string
86
+ /** 主设备ID */
87
+ masterDevId: string
88
+ complete?: () => void
89
+ success?: (params: boolean) => void
90
+ fail?: (params: {
91
+ errorMsg: string
92
+ errorCode: string | number
93
+ innerError: {
94
+ errorCode: string | number
95
+ errorMsg: string
96
+ }
97
+ }) => void
98
+ }): void
99
+
100
+ /**
101
+ * 从设备移除
102
+ */
103
+ export function unbindDevice(params: {
104
+ /** 从设备ID */
105
+ devId: string
106
+ complete?: () => void
107
+ success?: (params: boolean) => void
108
+ fail?: (params: {
109
+ errorMsg: string
110
+ errorCode: string | number
111
+ innerError: {
112
+ errorCode: string | number
113
+ errorMsg: string
114
+ }
115
+ }) => void
116
+ }): void
117
+
118
+ /**
119
+ * 小程序表盘设置
120
+ */
121
+ export function saveDialViewTag(params: {
122
+ /** 表盘左侧 */
123
+ leftViewTag: string
124
+ /** 表盘中间数据 */
125
+ centerViewTag: string
126
+ /** 表盘右侧数据 */
127
+ rightViewTag: string
128
+ complete?: () => void
129
+ success?: (params: boolean) => void
130
+ fail?: (params: {
131
+ errorMsg: string
132
+ errorCode: string | number
133
+ innerError: {
134
+ errorCode: string | number
135
+ errorMsg: string
136
+ }
137
+ }) => void
138
+ }): void
139
+
140
+ /**
141
+ * 保存骑行语音播报数据
142
+ */
143
+ export function saveTTSData(params: {
144
+ /** 骑行数据播报总开关 */
145
+ ttsMainSwitch: boolean
146
+ /** 天气 */
147
+ weather: boolean
148
+ /** 骑行数据播报总开关 */
149
+ abnormalWear: boolean
150
+ /** 骑行里程 */
151
+ cyclingMileage: boolean
152
+ /** 低电量 */
153
+ lowBattery: boolean
154
+ /** 具体电量数值 */
155
+ electricThreshold: number
156
+ /** 骑行里程 */
157
+ callReminder: boolean
158
+ complete?: () => void
159
+ success?: (params: boolean) => void
160
+ fail?: (params: {
161
+ errorMsg: string
162
+ errorCode: string | number
163
+ innerError: {
164
+ errorCode: string | number
165
+ errorMsg: string
166
+ }
167
+ }) => void
168
+ }): void
169
+
170
+ /**
171
+ * 获取骑行播报数据
172
+ */
173
+ export function getTTSData(params?: {
174
+ complete?: () => void
175
+ success?: (params: {
176
+ /** 骑行数据播报总开关 */
177
+ ttsMainSwitch: boolean
178
+ /** 天气 */
179
+ weather: boolean
180
+ /** 骑行数据播报总开关 */
181
+ abnormalWear: boolean
182
+ /** 骑行里程 */
183
+ cyclingMileage: boolean
184
+ /** 低电量 */
185
+ lowBattery: boolean
186
+ /** 具体电量数值 */
187
+ electricThreshold: number
188
+ /** 骑行里程 */
189
+ callReminder: boolean
190
+ }) => void
191
+ fail?: (params: {
192
+ errorMsg: string
193
+ errorCode: string | number
194
+ innerError: {
195
+ errorCode: string | number
196
+ errorMsg: string
197
+ }
198
+ }) => void
199
+ }): void
200
+
201
+ /**
202
+ * 是否有通话权限
203
+ */
204
+ export function isCallPhoneGranted(params?: {
205
+ complete?: () => void
206
+ success?: (params: boolean) => void
207
+ fail?: (params: {
208
+ errorMsg: string
209
+ errorCode: string | number
210
+ innerError: {
211
+ errorCode: string | number
212
+ errorMsg: string
213
+ }
214
+ }) => void
215
+ }): void
216
+
217
+ /**
218
+ * 申请通话权限
219
+ */
220
+ export function requestCallPhonePermission(params?: {
221
+ complete?: () => void
222
+ success?: (params: boolean) => void
223
+ fail?: (params: {
224
+ errorMsg: string
225
+ errorCode: string | number
226
+ innerError: {
227
+ errorCode: string | number
228
+ errorMsg: string
229
+ }
230
+ }) => void
231
+ }): void
232
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * P2PKit
3
3
  *
4
- * @version 2.0.3
4
+ * @version 2.1.0
5
5
  */
6
6
  declare namespace ty.p2p {
7
7
  /**
@@ -9,7 +9,7 @@ declare namespace ty.p2p {
9
9
  */
10
10
  export function P2PSDKInit(params: {
11
11
  /** 用户id */
12
- userId: string
12
+ userId?: string
13
13
  complete?: () => void
14
14
  success?: (params: null) => void
15
15
  fail?: (params: {
@@ -168,6 +168,28 @@ declare namespace ty.p2p {
168
168
  }) => void
169
169
  }): void
170
170
 
171
+ /**
172
+ * P2P追加下载数据流
173
+ */
174
+ export function appendDownloadStream(params: {
175
+ /** 设备id */
176
+ deviceId: string
177
+ /** albumName 和设备端约定字段 */
178
+ albumName: string
179
+ /** 下载的文件名称,eg: {"files":["filesname1", "filesname2", "filesname3" ]} */
180
+ jsonfiles: string
181
+ complete?: () => void
182
+ success?: (params: null) => void
183
+ fail?: (params: {
184
+ errorMsg: string
185
+ errorCode: string | number
186
+ innerError: {
187
+ errorCode: string | number
188
+ errorMsg: string
189
+ }
190
+ }) => void
191
+ }): void
192
+
171
193
  /**
172
194
  * 取消传输任务
173
195
  */
@@ -6,3 +6,4 @@
6
6
  /// <reference path="./MapKit.d.ts" />
7
7
  /// <reference path="./HomeKit.d.ts" />
8
8
  /// <reference path="./P2PKit.d.ts" />
9
+ /// <reference path="./OutdoorKit.d.ts" />
@@ -60,8 +60,8 @@ interface CreateAnimationProps {
60
60
 
61
61
  interface NodesRef {
62
62
  fields(e: any, t: any): SelectorQuery
63
- boundingClientRect(e: any): SelectorQuery
64
- scrollOffset(e: any): SelectorQuery
63
+ boundingClientRect(e?: any): SelectorQuery
64
+ scrollOffset(e?: any): SelectorQuery
65
65
  }
66
66
  interface SelectorQuery {
67
67
  select: (e: any) => NodesRef
@@ -221,6 +221,11 @@ interface CameraContext {
221
221
  ): void
222
222
  setZoom(res: Callback & { zoom: number; success(res: { zoom: number }): void }): void
223
223
  }
224
+
225
+ interface WebviewContext {
226
+ postMessage(options: { data: Record<string, any> }): void
227
+ reload(options: Callback): void
228
+ }
224
229
  declare namespace ty {
225
230
  /**
226
231
  * 小程序云能力
@@ -275,6 +280,7 @@ declare namespace ty {
275
280
  export function createMapContext(mapId: string): MapContext
276
281
  export function createIpcPlayerContext(deviceId: string): IpcContext
277
282
  export function createCameraContext(): CameraContext
283
+ export function createWebviewContext(mapId: string): WebviewContext
278
284
  export type env = {
279
285
  USER_DATA_PATH: string
280
286
  }
package/@types/index.d.ts CHANGED
@@ -15,3 +15,90 @@ interface I18nInfo {
15
15
  declare class I18n {
16
16
  static t: (key: string) => string
17
17
  }
18
+
19
+ declare enum WidgetVersionType {
20
+ /** 线上版本 */
21
+ release = 'release',
22
+
23
+ /** 预发版本 */
24
+ preview = 'preview',
25
+ }
26
+
27
+ declare enum WidgetPosition {
28
+ /** 居底展示 */
29
+ bottom = 'bottom',
30
+
31
+ /** 居顶展示 */
32
+ top = 'top',
33
+ }
34
+
35
+ declare enum HTTPMethod {
36
+ /** HTTP 请求 OPTIONS */
37
+ OPTIONS = 'OPTIONS',
38
+
39
+ /** HTTP 请求 GET */
40
+ GET = 'GET',
41
+
42
+ /** HTTP 请求 HEAD */
43
+ HEAD = 'HEAD',
44
+
45
+ /** HTTP 请求 POST */
46
+ POST = 'POST',
47
+
48
+ /** HTTP 请求 PUT */
49
+ PUT = 'PUT',
50
+
51
+ /** HTTP 请求 DELETE */
52
+ DELETE = 'DELETE',
53
+
54
+ /** HTTP 请求 TRACE */
55
+ TRACE = 'TRACE',
56
+
57
+ /** HTTP 请求 TRACE */
58
+ CONNECT = 'CONNECT',
59
+ }
60
+
61
+ declare enum AccelerometerInterval {
62
+ /** 适用于更新游戏的回调频率,在 20ms/次 左右 */
63
+ game = 'game',
64
+
65
+ /** 适用于更新 UI 的回调频率,在 60ms/次 左右 */
66
+ ui = 'ui',
67
+
68
+ /** 普通的回调频率,在 200ms/次 左右 */
69
+ normal = 'normal',
70
+ }
71
+
72
+ declare enum DeviceMotionInterval {
73
+ /** 适用于更新游戏的回调频率,在 20ms/次 左右 */
74
+ game = 'game',
75
+
76
+ /** 适用于更新 UI 的回调频率,在 60ms/次 左右 */
77
+ ui = 'ui',
78
+
79
+ /** 普通的回调频率,在 200ms/次 左右 */
80
+ normal = 'normal',
81
+ }
82
+
83
+ declare enum GyroscopeInterval {
84
+ /** 适用于更新游戏的回调频率,在 20ms/次 左右 */
85
+ game = 'game',
86
+
87
+ /** 适用于更新 UI 的回调频率,在 60ms/次 左右 */
88
+ ui = 'ui',
89
+
90
+ /** 普通的回调频率,在 200ms/次 左右 */
91
+ normal = 'normal',
92
+ }
93
+
94
+ declare enum Themes {
95
+ dark = 'dark',
96
+
97
+ light = 'light',
98
+ }
99
+
100
+ declare enum Orientation {
101
+ portrait = 'portrait',
102
+
103
+ landscape = 'landscape',
104
+ }
@@ -81,3 +81,4 @@ export declare const getRecorderManager: typeof ty.getRecorderManager;
81
81
  export declare const uploadFile: typeof ty.uploadFile;
82
82
  export declare const openMiniWidget: typeof ty.openMiniWidget;
83
83
  export declare const getCurrentVolumeByMode: typeof ty.getCurrentVolumeByMode;
84
+ export declare const saveImageToPhotosAlbum: typeof ty.saveImageToPhotosAlbum;
@@ -1,6 +1,7 @@
1
1
  /// <reference path="../@types/BaseKit.d.ts" />
2
2
 
3
- import { factory } from './utils';
3
+ import { createFactory } from './utils';
4
+ const factory = createFactory('BaseKit');
4
5
  export const stopAccelerometer = factory('stopAccelerometer');
5
6
  export const startAccelerometer = factory('startAccelerometer');
6
7
  export const getAudioFileDuration = factory('getAudioFileDuration');
@@ -85,4 +86,7 @@ export const uploadFile = factory('uploadFile');
85
86
  export const openMiniWidget = factory('openMiniWidget');
86
87
 
87
88
  // 3.3.10 新增 - 4.8.0 容器
88
- export const getCurrentVolumeByMode = factory('getCurrentVolumeByMode');
89
+ export const getCurrentVolumeByMode = factory('getCurrentVolumeByMode');
90
+
91
+ // 3.11.0 新增 - 5.12.0
92
+ export const saveImageToPhotosAlbum = factory('saveImageToPhotosAlbum');