@ray-js/api 1.7.40 → 1.7.42
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/DeviceKit.d.ts +153 -0
- package/lib/DeviceKit-4.13.1.d.ts +1 -0
- package/lib/DeviceKit-4.13.1.js +5 -0
- package/package.json +5 -5
package/@types/DeviceKit.d.ts
CHANGED
@@ -3,7 +3,160 @@
|
|
3
3
|
*
|
4
4
|
* @version 4.13.1
|
5
5
|
*/
|
6
|
+
|
7
|
+
interface WifiInfo {
|
8
|
+
ssid: string;
|
9
|
+
password: string;
|
10
|
+
}
|
11
|
+
interface NetworkInfo {
|
12
|
+
/* 网络类型, 0:wifi, 1:有线, 2:4G */
|
13
|
+
network: number;
|
14
|
+
ssid: string;
|
15
|
+
/* 信号强度 */
|
16
|
+
signal: number;
|
17
|
+
/* 设备 flags 标识 */
|
18
|
+
flags?: number;
|
19
|
+
/* ssid hash */
|
20
|
+
hashValue: string
|
21
|
+
}
|
22
|
+
interface NetworkBackupModel {
|
23
|
+
ssid: string;
|
24
|
+
password?: string;
|
25
|
+
/* ssid hash */
|
26
|
+
hashValue?: string;
|
27
|
+
}
|
28
|
+
interface BackupNetworkContext {
|
29
|
+
/** 是否支持备份网络 */
|
30
|
+
checkBackupNetworkAbility: (params: {
|
31
|
+
success?: (params: {
|
32
|
+
result: boolean
|
33
|
+
}) => void,
|
34
|
+
fail?: (params: {
|
35
|
+
/** 错误信息 */
|
36
|
+
errorMsg: string
|
37
|
+
/* 错误码 */
|
38
|
+
errorCode: string
|
39
|
+
}) => void,
|
40
|
+
complete?: (params: null) => void
|
41
|
+
}) => void;
|
42
|
+
|
43
|
+
/** 获取设备当前的网络信息 */
|
44
|
+
getCurrentNetworkInfo: (params: {
|
45
|
+
success?: (params: {
|
46
|
+
info: NetworkInfo
|
47
|
+
}) => void,
|
48
|
+
fail?: (params: {
|
49
|
+
/** 错误信息 */
|
50
|
+
errorMsg: string
|
51
|
+
/* 错误码 */
|
52
|
+
errorCode: string
|
53
|
+
}) => void,
|
54
|
+
complete?: (params: null) => void
|
55
|
+
}) => void;
|
56
|
+
|
57
|
+
/** 获取设备备份的网络信息 */
|
58
|
+
getBackupNetworkInfos: (params: {
|
59
|
+
success?: (params: {
|
60
|
+
infos: NetworkBackupModel[],
|
61
|
+
NetworkBackupModel: number
|
62
|
+
}) => void,
|
63
|
+
fail?: (params: {
|
64
|
+
/** 错误信息 */
|
65
|
+
errorMsg: string
|
66
|
+
/* 错误码 */
|
67
|
+
errorCode: string
|
68
|
+
}) => void,
|
69
|
+
complete?: (params: null) => void
|
70
|
+
}) => void;
|
71
|
+
|
72
|
+
/* 生成备用网络信息 */
|
73
|
+
generateBackupNetworkInfo: (params: {
|
74
|
+
wifiInfo: WifiInfo,
|
75
|
+
success?: (params: {
|
76
|
+
info: NetworkBackupModel
|
77
|
+
}) => void,
|
78
|
+
fail?: (params: {
|
79
|
+
/** 错误信息 */
|
80
|
+
errorMsg: string
|
81
|
+
/* 错误码 */
|
82
|
+
errorCode: string
|
83
|
+
}) => void,
|
84
|
+
complete?: (params: null) => void
|
85
|
+
}) => void;
|
86
|
+
|
87
|
+
/** 检查是否可以更新备用网络 */
|
88
|
+
checkWhetherCanUpdateBackupNetwork: (params: {
|
89
|
+
info: NetworkInfo,
|
90
|
+
success?: (params: {
|
91
|
+
result: boolean
|
92
|
+
}) => void,
|
93
|
+
fail?: (params: {
|
94
|
+
/** 错误信息 */
|
95
|
+
errorMsg: string
|
96
|
+
/* 错误码 */
|
97
|
+
errorCode: string
|
98
|
+
}) => void,
|
99
|
+
complete?: (params: null) => void
|
100
|
+
}) => void;
|
101
|
+
|
102
|
+
/** 更新备用网络 */
|
103
|
+
updateBackupNetwork: (params: {
|
104
|
+
networks: NetworkBackupModel[],
|
105
|
+
success?: (params: null) => void,
|
106
|
+
fail?: (params: {
|
107
|
+
/** 错误信息 */
|
108
|
+
errorMsg: string
|
109
|
+
/* 错误码 */
|
110
|
+
errorCode: string
|
111
|
+
}) => void,
|
112
|
+
complete?: (params: null) => void
|
113
|
+
}) => void;
|
114
|
+
|
115
|
+
/** 检查是否可以切换备用网络 */
|
116
|
+
checkWhetherCanSwitchBackupNetwork: (params: {
|
117
|
+
info: NetworkInfo,
|
118
|
+
success?: (params: {
|
119
|
+
result: boolean
|
120
|
+
}) => void,
|
121
|
+
fail?: (params: {
|
122
|
+
/** 错误信息 */
|
123
|
+
errorMsg: string
|
124
|
+
/* 错误码 */
|
125
|
+
errorCode: string
|
126
|
+
}) => void,
|
127
|
+
complete?: (params: null) => void
|
128
|
+
}) => void;
|
129
|
+
|
130
|
+
/** 切换备用网络 */
|
131
|
+
switchBackupNetwork: (params: {
|
132
|
+
/* 使用 ssid hash 进行切换 */
|
133
|
+
hashValue?: string,
|
134
|
+
/* 使用 wifi 信息进行切换 */
|
135
|
+
wifiInfo?: WifiInfo,
|
136
|
+
success?: (params: null) => void,
|
137
|
+
fail?: (params: {
|
138
|
+
/** 错误信息 */
|
139
|
+
errorMsg: string
|
140
|
+
/* 错误码 */
|
141
|
+
errorCode: string
|
142
|
+
}) => void,
|
143
|
+
complete?: (params: null) => void
|
144
|
+
}) => void;
|
145
|
+
}
|
6
146
|
declare namespace ty.device {
|
147
|
+
/**
|
148
|
+
*@description 创建内部 DeviceNetworkManager 上下文*/
|
149
|
+
export function getDeviceNetworkManager(params: {
|
150
|
+
/** 设备模型 设备id */
|
151
|
+
deviceId: string
|
152
|
+
success?: (params: null) => void
|
153
|
+
fail?: (params: {
|
154
|
+
errorMsg: string
|
155
|
+
errorCode: string | number
|
156
|
+
}) => void
|
157
|
+
complete?: () => void
|
158
|
+
}): BackupNetworkContext
|
159
|
+
|
7
160
|
/**
|
8
161
|
*@description 注册监听远离beacon设备范围事件*/
|
9
162
|
export function unregisterLeaveBeaconFenceEvent(params: {
|
@@ -244,3 +244,4 @@ export declare const subDeviceReplace: typeof ty.device.subDeviceReplace;
|
|
244
244
|
export declare const fetchReplacementOutcomeJobModel: typeof ty.device.fetchReplacementOutcomeJobModel;
|
245
245
|
export declare const getMeshDeviceIdHex: typeof ty.device.getMeshDeviceIdHex;
|
246
246
|
export declare const onSubDeviceReplaceResult: typeof ty.device.onSubDeviceReplaceResult;
|
247
|
+
export declare const getDeviceNetworkManager: typeof ty.device.getDeviceNetworkManager;
|
package/lib/DeviceKit-4.13.1.js
CHANGED
@@ -755,4 +755,9 @@ export const getMeshDeviceIdHex = factory('getMeshDeviceIdHex', {
|
|
755
755
|
});
|
756
756
|
export const onSubDeviceReplaceResult = factory('onSubDeviceReplaceResult', {
|
757
757
|
"namespace": "device"
|
758
|
+
});
|
759
|
+
|
760
|
+
// 4.20.7 新增
|
761
|
+
export const getDeviceNetworkManager = factory('getDeviceNetworkManager', {
|
762
|
+
"namespace": "device"
|
758
763
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/api",
|
3
|
-
"version": "1.7.
|
3
|
+
"version": "1.7.42",
|
4
4
|
"description": "Ray universal api",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -29,8 +29,8 @@
|
|
29
29
|
"watch": "ray start --type=component"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@ray-js/framework": "1.7.
|
33
|
-
"@ray-js/router": "1.7.
|
32
|
+
"@ray-js/framework": "1.7.42",
|
33
|
+
"@ray-js/router": "1.7.42",
|
34
34
|
"base64-browser": "^1.0.1",
|
35
35
|
"query-string": "^7.1.3"
|
36
36
|
},
|
@@ -38,7 +38,7 @@
|
|
38
38
|
"@ray-js/wechat": "^0.3.13"
|
39
39
|
},
|
40
40
|
"devDependencies": {
|
41
|
-
"@ray-js/cli": "1.7.
|
41
|
+
"@ray-js/cli": "1.7.42",
|
42
42
|
"art-template": "^4.13.4",
|
43
43
|
"fs-extra": "^10.1.0",
|
44
44
|
"miniprogram-api-typings": "^3.12.3",
|
@@ -48,5 +48,5 @@
|
|
48
48
|
"access": "public",
|
49
49
|
"registry": "https://registry.npmjs.org"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "9e3b039de41328fdebad855d23830e342b4bfaa5"
|
52
52
|
}
|