@ray-js/api 1.4.39 → 1.4.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/MapKit.d.ts +142 -1
- package/@types/OutdoorKit.d.ts +232 -0
- package/@types/all-kits.d.ts +1 -0
- package/lib/{MapKit-3.4.9.d.ts → MapKit-3.4.13.d.ts} +4 -0
- package/lib/{MapKit-3.4.9.js → MapKit-3.4.13.js} +13 -0
- package/lib/OutdoorKit-1.0.4.d.ts +14 -0
- package/lib/OutdoorKit-1.0.4.js +38 -0
- package/lib/all-kits.d.ts +2 -1
- package/lib/all-kits.js +2 -1
- package/package.json +5 -5
package/@types/MapKit.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* MapKit
|
3
3
|
*
|
4
|
-
* @version 3.4.
|
4
|
+
* @version 3.4.13
|
5
5
|
*/
|
6
6
|
declare namespace ty.map {
|
7
7
|
/**
|
@@ -319,6 +319,124 @@ declare namespace ty.map {
|
|
319
319
|
}) => void
|
320
320
|
}): void
|
321
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
|
+
|
322
440
|
export type GeofenceInfo = {
|
323
441
|
/** 地理围栏名称 */
|
324
442
|
geoTitle?: string
|
@@ -466,4 +584,27 @@ declare namespace ty.map {
|
|
466
584
|
/** 区名, 次级区域名 */
|
467
585
|
district: string
|
468
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
|
+
}
|
469
610
|
}
|
@@ -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
|
+
}
|
package/@types/all-kits.d.ts
CHANGED
@@ -10,4 +10,8 @@ export declare const map: {
|
|
10
10
|
unregisterGeofence: typeof ty.map.unregisterGeofence;
|
11
11
|
updateGeofence: typeof ty.map.updateGeofence;
|
12
12
|
transformLocation: typeof ty.map.transformLocation;
|
13
|
+
reverseGeocodeLocation: typeof ty.map.reverseGeocodeLocation;
|
14
|
+
coordinateWGS84ToGCJ02: typeof ty.map.coordinateWGS84ToGCJ02;
|
15
|
+
coordinateGCJ02ToWGS84: typeof ty.map.coordinateGCJ02ToWGS84;
|
16
|
+
getMapType: typeof ty.map.getMapType;
|
13
17
|
};
|
@@ -34,5 +34,18 @@ export const map = {
|
|
34
34
|
// MapKit >=3.2.2 ray 1.4.38 新增
|
35
35
|
transformLocation: factory('transformLocation', {
|
36
36
|
"namespace": "map"
|
37
|
+
}),
|
38
|
+
// MapKit >=3.4.13 ray 1.4.41 新增
|
39
|
+
reverseGeocodeLocation: factory('reverseGeocodeLocation', {
|
40
|
+
"namespace": "map"
|
41
|
+
}),
|
42
|
+
coordinateWGS84ToGCJ02: factory('coordinateWGS84ToGCJ02', {
|
43
|
+
"namespace": "map"
|
44
|
+
}),
|
45
|
+
coordinateGCJ02ToWGS84: factory('coordinateGCJ02ToWGS84', {
|
46
|
+
"namespace": "map"
|
47
|
+
}),
|
48
|
+
getMapType: factory('getMapType', {
|
49
|
+
"namespace": "map"
|
37
50
|
})
|
38
51
|
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/// <reference path="../@types/OutdoorKit.d.ts" />
|
2
|
+
export declare const outdoor: {
|
3
|
+
bindSlaveDevice: typeof ty.outdoor.bindSlaveDevice;
|
4
|
+
currentDevice: typeof ty.outdoor.currentDevice;
|
5
|
+
getBoundDeviceIdList: typeof ty.outdoor.getBoundDeviceIdList;
|
6
|
+
getTTSData: typeof ty.outdoor.getTTSData;
|
7
|
+
getUnbindDeviceIdList: typeof ty.outdoor.getUnbindDeviceIdList;
|
8
|
+
isCallPhoneGranted: typeof ty.outdoor.isCallPhoneGranted;
|
9
|
+
requestCallPhonePermission: typeof ty.outdoor.requestCallPhonePermission;
|
10
|
+
saveDialViewTag: typeof ty.outdoor.saveDialViewTag;
|
11
|
+
saveTTSData: typeof ty.outdoor.saveTTSData;
|
12
|
+
switchDevice: typeof ty.outdoor.switchDevice;
|
13
|
+
unbindDevice: typeof ty.outdoor.unbindDevice;
|
14
|
+
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/// <reference path="../@types/OutdoorKit.d.ts" />
|
2
|
+
|
3
|
+
import { factory } from './utils';
|
4
|
+
export const outdoor = {
|
5
|
+
bindSlaveDevice: factory('bindSlaveDevice', {
|
6
|
+
"namespace": "outdoor"
|
7
|
+
}),
|
8
|
+
currentDevice: factory('currentDevice', {
|
9
|
+
"namespace": "outdoor"
|
10
|
+
}),
|
11
|
+
getBoundDeviceIdList: factory('getBoundDeviceIdList', {
|
12
|
+
"namespace": "outdoor"
|
13
|
+
}),
|
14
|
+
getTTSData: factory('getTTSData', {
|
15
|
+
"namespace": "outdoor"
|
16
|
+
}),
|
17
|
+
getUnbindDeviceIdList: factory('getUnbindDeviceIdList', {
|
18
|
+
"namespace": "outdoor"
|
19
|
+
}),
|
20
|
+
isCallPhoneGranted: factory('isCallPhoneGranted', {
|
21
|
+
"namespace": "outdoor"
|
22
|
+
}),
|
23
|
+
requestCallPhonePermission: factory('requestCallPhonePermission', {
|
24
|
+
"namespace": "outdoor"
|
25
|
+
}),
|
26
|
+
saveDialViewTag: factory('saveDialViewTag', {
|
27
|
+
"namespace": "outdoor"
|
28
|
+
}),
|
29
|
+
saveTTSData: factory('saveTTSData', {
|
30
|
+
"namespace": "outdoor"
|
31
|
+
}),
|
32
|
+
switchDevice: factory('switchDevice', {
|
33
|
+
"namespace": "outdoor"
|
34
|
+
}),
|
35
|
+
unbindDevice: factory('unbindDevice', {
|
36
|
+
"namespace": "outdoor"
|
37
|
+
})
|
38
|
+
};
|
package/lib/all-kits.d.ts
CHANGED
@@ -3,8 +3,9 @@ export * from './BizKit-3.2.7';
|
|
3
3
|
export * from './DeviceKit-3.3.1';
|
4
4
|
export * from './MiniKit-3.1.0';
|
5
5
|
export * from './PlayNetKit-1.1.3';
|
6
|
-
export * from './MapKit-3.4.
|
6
|
+
export * from './MapKit-3.4.13';
|
7
7
|
export * from './HomeKit-3.1.4';
|
8
8
|
export * from './P2PKit-2.0.3';
|
9
|
+
export * from './OutdoorKit-1.0.4';
|
9
10
|
import * as device from './DeviceKit-3.3.1';
|
10
11
|
export { device };
|
package/lib/all-kits.js
CHANGED
@@ -3,8 +3,9 @@ export * from './BizKit-3.2.7';
|
|
3
3
|
export * from './DeviceKit-3.3.1';
|
4
4
|
export * from './MiniKit-3.1.0';
|
5
5
|
export * from './PlayNetKit-1.1.3';
|
6
|
-
export * from './MapKit-3.4.
|
6
|
+
export * from './MapKit-3.4.13';
|
7
7
|
export * from './HomeKit-3.1.4';
|
8
8
|
export * from './P2PKit-2.0.3';
|
9
|
+
export * from './OutdoorKit-1.0.4';
|
9
10
|
import * as device from './DeviceKit-3.3.1';
|
10
11
|
export { device };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.41",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,14 +29,14 @@
|
|
29
29
|
"watch": "ray start --type=component"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@ray-js/framework": "1.4.
|
33
|
-
"@ray-js/router": "1.4.
|
32
|
+
"@ray-js/framework": "1.4.41",
|
33
|
+
"@ray-js/router": "1.4.41",
|
34
34
|
"@ray-js/wechat": "^0.0.33",
|
35
35
|
"base64-browser": "^1.0.1",
|
36
36
|
"query-string": "^7.1.3"
|
37
37
|
},
|
38
38
|
"devDependencies": {
|
39
|
-
"@ray-js/cli": "1.4.
|
39
|
+
"@ray-js/cli": "1.4.41",
|
40
40
|
"art-template": "^4.13.2",
|
41
41
|
"fs-extra": "^10.1.0",
|
42
42
|
"miniprogram-api-typings": "^3.12.2",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"access": "public",
|
47
47
|
"registry": "https://registry.npmjs.org"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "9fc4546a5140a252c0659e95f4aa1c73b30b3355"
|
50
50
|
}
|