@ray-js/api 1.7.69 → 1.7.71
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/AIKit.d.ts +5509 -610
- package/@types/AIStreamKit.d.ts +2641 -0
- package/@types/AVideoKit.d.ts +1827 -0
- package/@types/BaseKit.d.ts +8682 -1893
- package/@types/BizKit.d.ts +6639 -1038
- package/@types/CategoryCommonBizKit.d.ts +1459 -0
- package/@types/CommunityKit.d.ts +154 -0
- package/@types/DeviceKit.d.ts +18475 -5662
- package/@types/GroupCITestKit.d.ts +651 -0
- package/@types/HealthKit.d.ts +2290 -357
- package/@types/HomeKit.d.ts +4068 -182
- package/@types/IPCKit.d.ts +4327 -1227
- package/@types/LightKit.d.ts +125 -0
- package/@types/MapKit.d.ts +1560 -204
- package/@types/MediaKit.d.ts +136 -16
- package/@types/MediaPlayerKit.d.ts +47 -0
- package/@types/MiniKit.d.ts +2976 -628
- package/@types/OutdoorKit.d.ts +1337 -24
- package/@types/P2PKit.d.ts +622 -103
- package/@types/PayKit.d.ts +115 -0
- package/@types/PlayNetKit.d.ts +3454 -1309
- package/@types/SweeperKit.d.ts +154 -0
- package/@types/ThirdAuthKit.d.ts +324 -0
- package/@types/ThirdPartyDeviceKit.d.ts +410 -0
- package/@types/WearKit.d.ts +10177 -375
- package/@types/gateway.d.ts +349 -61
- package/@types/health.d.ts +486 -304
- package/lib/AIKit-1.6.0.d.ts +265 -41
- package/lib/AIKit-1.6.0.js +374 -120
- package/lib/BaseKit-3.17.7.d.ts +704 -0
- package/lib/BaseKit-3.17.7.js +720 -1
- package/lib/BizKit-4.10.4.d.ts +336 -0
- package/lib/BizKit-4.10.4.js +342 -5
- package/lib/DeviceKit-4.13.1.d.ts +996 -0
- package/lib/DeviceKit-4.13.1.js +1247 -249
- package/lib/HealthKit-6.5.0.d.ts +210 -44
- package/lib/HealthKit-6.5.0.js +295 -128
- package/lib/HomeKit-3.1.4.d.ts +20 -6
- package/lib/HomeKit-3.1.4.js +29 -14
- package/lib/IPCKit-6.4.5.d.ts +375 -77
- package/lib/IPCKit-6.4.5.js +525 -228
- package/lib/MapKit-3.4.13.d.ts +70 -16
- package/lib/MapKit-3.4.13.js +98 -47
- package/lib/MediaKit-3.4.1.d.ts +5 -3
- package/lib/MediaKit-3.4.1.js +7 -6
- package/lib/MiniKit-3.14.1.d.ts +300 -0
- package/lib/MiniKit-3.14.1.js +302 -0
- package/lib/OutdoorKit-1.0.4.d.ts +55 -13
- package/lib/OutdoorKit-1.0.4.js +78 -35
- package/lib/P2PKit-2.0.3.d.ts +125 -27
- package/lib/P2PKit-2.0.3.js +175 -78
- package/lib/PlayNetKit-1.3.30.d.ts +290 -60
- package/lib/PlayNetKit-1.3.30.js +407 -176
- package/lib/WearKit-1.1.6.d.ts +125 -27
- package/lib/WearKit-1.1.6.js +176 -77
- package/lib/all-kits.d.ts +10 -10
- package/lib/all-kits.js +10 -10
- package/lib/cloud/core.d.ts +31 -1
- package/lib/cloud/core.js +31 -1
- package/lib/cloud/device.d.ts +155 -24
- package/lib/cloud/device.js +153 -22
- package/lib/cloud/gateway.d.ts +254 -0
- package/lib/cloud/gateway.js +269 -9
- package/lib/cloud/health.d.ts +1 -0
- package/lib/cloud/health.js +121 -0
- package/lib/cloud/interface.d.ts +222 -44
- package/lib/cloud/interface.js +15 -2
- package/lib/cloud/laser-clean/deleteCleaningRecord/index.d.ts +27 -0
- package/lib/cloud/laser-clean/deleteCleaningRecord/index.js +28 -0
- package/lib/cloud/laser-clean/deleteCleaningRecord/type.d.ts +7 -0
- package/lib/cloud/laser-clean/deleteCleaningRecord/type.js +1 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/index.d.ts +27 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/index.js +28 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/type.d.ts +7 -0
- package/lib/cloud/laser-clean/deleteGyroCleanRecord/type.js +1 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/index.d.ts +27 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/index.js +28 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/type.d.ts +7 -0
- package/lib/cloud/laser-clean/deleteMultipleMapFiles/type.js +1 -0
- package/lib/cloud/laser-clean/getCleaningRecords/index.d.ts +30 -0
- package/lib/cloud/laser-clean/getCleaningRecords/index.js +31 -0
- package/lib/cloud/laser-clean/getCleaningRecords/type.d.ts +39 -0
- package/lib/cloud/laser-clean/getCleaningRecords/type.js +1 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/index.d.ts +29 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/index.js +30 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/type.d.ts +30 -0
- package/lib/cloud/laser-clean/getGyroCleanRecordDetail/type.js +1 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/index.d.ts +29 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/index.js +30 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/type.d.ts +35 -0
- package/lib/cloud/laser-clean/getGyroCleanRecords/type.js +1 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/index.d.ts +28 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/index.js +29 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/type.d.ts +28 -0
- package/lib/cloud/laser-clean/getGyroLatestCleanMap/type.js +1 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/index.d.ts +24 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/index.js +25 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/type.d.ts +29 -0
- package/lib/cloud/laser-clean/getMultipleMapFiles/type.js +1 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/index.d.ts +24 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/index.js +25 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/type.d.ts +26 -0
- package/lib/cloud/laser-clean/getSweeperStorageConfig/type.js +1 -0
- package/lib/cloud/laser-clean/getVoiceList/index.d.ts +28 -0
- package/lib/cloud/laser-clean/getVoiceList/index.js +29 -0
- package/lib/cloud/laser-clean/getVoiceList/type.d.ts +48 -0
- package/lib/cloud/laser-clean/getVoiceList/type.js +1 -0
- package/lib/cloud/laser-clean/index.d.ts +1 -1
- package/lib/cloud/laser-clean/index.js +1 -1
- package/lib/cloud/laser-clean/map.d.ts +5 -7
- package/lib/cloud/laser-clean/map.js +5 -9
- package/lib/cloud/laser-clean/record.d.ts +5 -6
- package/lib/cloud/laser-clean/record.js +5 -7
- package/lib/cloud/laser-clean/renameHistoryMap/index.d.ts +28 -0
- package/lib/cloud/laser-clean/renameHistoryMap/index.js +29 -0
- package/lib/cloud/laser-clean/renameHistoryMap/type.d.ts +9 -0
- package/lib/cloud/laser-clean/renameHistoryMap/type.js +1 -0
- package/lib/cloud/laser-clean/voice.d.ts +1 -3
- package/lib/cloud/laser-clean/voice.js +1 -4
- package/lib/cloud/linkage.d.ts +271 -53
- package/lib/cloud/linkage.js +256 -51
- package/lib/cloud/remoteGroup.d.ts +37 -0
- package/lib/cloud/remoteGroup.js +37 -0
- package/lib/cloud/timer.d.ts +104 -26
- package/lib/cloud/timer.js +104 -26
- package/lib/getApp/index.thing.d.ts +47 -1
- package/lib/getApp/index.thing.js +40 -2
- package/lib/getBoundingClientRect/index.thing.d.ts +101 -1
- package/lib/getBoundingClientRect/index.thing.js +59 -0
- package/lib/getCurrentPages/index.thing.d.ts +40 -15
- package/lib/getCurrentPages/index.thing.js +36 -15
- package/lib/getCustomConfig/index.d.ts +5 -2
- package/lib/getCustomConfig/index.thing.d.ts +68 -2
- package/lib/getCustomConfig/index.thing.js +62 -0
- package/lib/getCustomConfig/index.wechat.d.ts +5 -2
- package/lib/getCustomConfig/type.d.ts +26 -15
- package/lib/getElementById/index.thing.d.ts +42 -1
- package/lib/getElementById/index.thing.js +40 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +4 -2
- package/lib/nativeRouters/common.d.ts +8 -0
- package/lib/nativeRouters/device.d.ts +137 -5
- package/lib/nativeRouters/device.js +138 -6
- package/lib/nativeRouters/gw.d.ts +58 -8
- package/lib/nativeRouters/gw.js +57 -8
- package/lib/nativeRouters/outdoors.d.ts +16 -3
- package/lib/nativeRouters/outdoors.js +16 -3
- package/lib/nativeRouters/remoteGroup.d.ts +23 -0
- package/lib/nativeRouters/remoteGroup.js +23 -0
- package/lib/nativeRouters/root.d.ts +19 -0
- package/lib/nativeRouters/root.js +17 -0
- package/lib/openGroupCreate/index.d.ts +45 -0
- package/lib/openGroupCreate/index.js +32 -0
- package/package.json +5 -5
package/@types/P2PKit.d.ts
CHANGED
|
@@ -1,424 +1,943 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* P2PKit
|
|
3
3
|
*
|
|
4
|
-
* @version
|
|
4
|
+
* @version 7.7.6
|
|
5
5
|
*/
|
|
6
6
|
declare namespace ty.p2p {
|
|
7
7
|
/**
|
|
8
|
-
* P2P SDK
|
|
8
|
+
* P2P SDK init
|
|
9
|
+
* @public
|
|
10
|
+
* @since P2PKit 0.0.1
|
|
11
|
+
* @platform iOS Android
|
|
9
12
|
*/
|
|
10
|
-
export function P2PSDKInit(params
|
|
11
|
-
/**
|
|
13
|
+
export function P2PSDKInit(params?: {
|
|
14
|
+
/**
|
|
15
|
+
* user id
|
|
16
|
+
* @since P2PKit 0.0.1
|
|
17
|
+
*/
|
|
12
18
|
userId?: string
|
|
19
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
13
20
|
complete?: () => void
|
|
21
|
+
/** 接口调用成功的回调函数 */
|
|
14
22
|
success?: (params: null) => void
|
|
23
|
+
/** 接口调用失败的回调函数 */
|
|
15
24
|
fail?: (params: {
|
|
25
|
+
/** 错误信息 */
|
|
16
26
|
errorMsg: string
|
|
27
|
+
/** 错误码 */
|
|
17
28
|
errorCode: string | number
|
|
29
|
+
/** 错误扩展 */
|
|
18
30
|
innerError: {
|
|
31
|
+
/** 错误扩展码 */
|
|
19
32
|
errorCode: string | number
|
|
33
|
+
/** 错误扩展信息 */
|
|
20
34
|
errorMsg: string
|
|
21
35
|
}
|
|
22
36
|
}) => void
|
|
23
37
|
}): void
|
|
24
38
|
|
|
25
39
|
/**
|
|
26
|
-
*
|
|
40
|
+
* P2P connect
|
|
41
|
+
* @public
|
|
42
|
+
* @since P2PKit 0.0.1
|
|
43
|
+
* @platform iOS Android
|
|
27
44
|
*/
|
|
28
45
|
export function connectDevice(params: {
|
|
29
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* device id
|
|
48
|
+
* @since P2PKit 0.0.1
|
|
49
|
+
*/
|
|
30
50
|
deviceId: string
|
|
31
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* connect mode,0:INTERNET 1:LAN
|
|
53
|
+
* @since P2PKit 0.0.1
|
|
54
|
+
* @defaultValue 0
|
|
55
|
+
*/
|
|
32
56
|
mode?: number
|
|
33
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* timeout,unit:ms, default as Internet:15000ms,Lan:3000ms
|
|
59
|
+
* @since P2PKit 0.0.1
|
|
60
|
+
* @defaultValue 0
|
|
61
|
+
*/
|
|
34
62
|
timeout?: number
|
|
63
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
35
64
|
complete?: () => void
|
|
65
|
+
/** 接口调用成功的回调函数 */
|
|
36
66
|
success?: (params: null) => void
|
|
67
|
+
/** 接口调用失败的回调函数 */
|
|
37
68
|
fail?: (params: {
|
|
69
|
+
/** 错误信息 */
|
|
38
70
|
errorMsg: string
|
|
71
|
+
/** 错误码 */
|
|
39
72
|
errorCode: string | number
|
|
73
|
+
/** 错误扩展 */
|
|
40
74
|
innerError: {
|
|
75
|
+
/** 错误扩展码 */
|
|
41
76
|
errorCode: string | number
|
|
77
|
+
/** 错误扩展信息 */
|
|
42
78
|
errorMsg: string
|
|
43
79
|
}
|
|
44
80
|
}) => void
|
|
45
81
|
}): void
|
|
46
82
|
|
|
47
83
|
/**
|
|
48
|
-
*
|
|
84
|
+
* check P2P status
|
|
85
|
+
* @public
|
|
86
|
+
* @since P2PKit 2.0.3
|
|
87
|
+
* @platform iOS Android
|
|
49
88
|
*/
|
|
50
89
|
export function isP2PActive(params: {
|
|
51
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* device id
|
|
92
|
+
* @since P2PKit 2.0.3
|
|
93
|
+
*/
|
|
52
94
|
deviceId: string
|
|
53
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* connect mode,0:INTERNET 1:LAN
|
|
97
|
+
* @since P2PKit 2.0.3
|
|
98
|
+
* @defaultValue 0
|
|
99
|
+
*/
|
|
54
100
|
mode?: number
|
|
55
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* timeout,unit:ms, default as Internet:15000ms,Lan:3000ms
|
|
103
|
+
* @since P2PKit 2.0.3
|
|
104
|
+
* @defaultValue 0
|
|
105
|
+
*/
|
|
56
106
|
timeout?: number
|
|
107
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
57
108
|
complete?: () => void
|
|
109
|
+
/** 接口调用成功的回调函数 */
|
|
58
110
|
success?: (params: null) => void
|
|
111
|
+
/** 接口调用失败的回调函数 */
|
|
59
112
|
fail?: (params: {
|
|
113
|
+
/** 错误信息 */
|
|
60
114
|
errorMsg: string
|
|
115
|
+
/** 错误码 */
|
|
61
116
|
errorCode: string | number
|
|
117
|
+
/** 错误扩展 */
|
|
62
118
|
innerError: {
|
|
119
|
+
/** 错误扩展码 */
|
|
63
120
|
errorCode: string | number
|
|
121
|
+
/** 错误扩展信息 */
|
|
64
122
|
errorMsg: string
|
|
65
123
|
}
|
|
66
124
|
}) => void
|
|
67
125
|
}): void
|
|
68
126
|
|
|
69
127
|
/**
|
|
70
|
-
*
|
|
128
|
+
* check P2P status
|
|
129
|
+
* @public
|
|
130
|
+
* @since P2PKit 2.0.3
|
|
131
|
+
* @platform iOS Android
|
|
71
132
|
*/
|
|
72
133
|
export function isP2PActiveSync(params?: ThingP2PConnectionParams): null
|
|
73
134
|
|
|
74
135
|
/**
|
|
75
|
-
*
|
|
136
|
+
* query device's album file index infos
|
|
137
|
+
* @public
|
|
138
|
+
* @since P2PKit 1.0.0
|
|
139
|
+
* @platform iOS Android
|
|
76
140
|
*/
|
|
77
141
|
export function queryAlbumFileIndexs(params: {
|
|
78
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* device id
|
|
144
|
+
* @since P2PKit 1.0.0
|
|
145
|
+
*/
|
|
79
146
|
deviceId: string
|
|
80
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* albumName,given by the device
|
|
149
|
+
* @since P2PKit 1.0.0
|
|
150
|
+
*/
|
|
81
151
|
albumName: string
|
|
152
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
82
153
|
complete?: () => void
|
|
154
|
+
/** 接口调用成功的回调函数 */
|
|
83
155
|
success?: (params: {
|
|
84
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* file count
|
|
158
|
+
* @since P2PKit 2.0.2
|
|
159
|
+
*/
|
|
85
160
|
count: number
|
|
86
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* file index infos
|
|
163
|
+
* @since P2PKit 2.0.2
|
|
164
|
+
*/
|
|
87
165
|
items: ThingP2PAlbumFileIndex[]
|
|
88
166
|
}) => void
|
|
167
|
+
/** 接口调用失败的回调函数 */
|
|
89
168
|
fail?: (params: {
|
|
169
|
+
/** 错误信息 */
|
|
90
170
|
errorMsg: string
|
|
171
|
+
/** 错误码 */
|
|
91
172
|
errorCode: string | number
|
|
173
|
+
/** 错误扩展 */
|
|
92
174
|
innerError: {
|
|
175
|
+
/** 错误扩展码 */
|
|
93
176
|
errorCode: string | number
|
|
177
|
+
/** 错误扩展信息 */
|
|
94
178
|
errorMsg: string
|
|
95
179
|
}
|
|
96
180
|
}) => void
|
|
97
181
|
}): void
|
|
98
182
|
|
|
99
183
|
/**
|
|
100
|
-
*
|
|
184
|
+
* upload file
|
|
185
|
+
* @public
|
|
186
|
+
* @since P2PKit 0.0.1
|
|
187
|
+
* @platform iOS Android
|
|
101
188
|
*/
|
|
102
189
|
export function uploadFile(params: {
|
|
103
|
-
/**
|
|
190
|
+
/**
|
|
191
|
+
* device id
|
|
192
|
+
* @since P2PKit 0.0.1
|
|
193
|
+
*/
|
|
104
194
|
deviceId: string
|
|
105
|
-
/**
|
|
195
|
+
/**
|
|
196
|
+
* albumName given by the device
|
|
197
|
+
* @since P2PKit 0.0.1
|
|
198
|
+
*/
|
|
106
199
|
albumName: string
|
|
107
|
-
/**
|
|
200
|
+
/**
|
|
201
|
+
* local file path
|
|
202
|
+
* @since P2PKit 0.0.1
|
|
203
|
+
*/
|
|
108
204
|
filePath: string
|
|
109
|
-
/**
|
|
205
|
+
/**
|
|
206
|
+
* ext data
|
|
207
|
+
* @since P2PKit 0.0.1
|
|
208
|
+
*/
|
|
110
209
|
extData?: string
|
|
111
|
-
/**
|
|
210
|
+
/**
|
|
211
|
+
* ext data length
|
|
212
|
+
* @since P2PKit 0.0.1
|
|
213
|
+
*/
|
|
112
214
|
extDataLength?: number
|
|
215
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
113
216
|
complete?: () => void
|
|
217
|
+
/** 接口调用成功的回调函数 */
|
|
114
218
|
success?: (params: null) => void
|
|
219
|
+
/** 接口调用失败的回调函数 */
|
|
115
220
|
fail?: (params: {
|
|
221
|
+
/** 错误信息 */
|
|
116
222
|
errorMsg: string
|
|
223
|
+
/** 错误码 */
|
|
117
224
|
errorCode: string | number
|
|
225
|
+
/** 错误扩展 */
|
|
118
226
|
innerError: {
|
|
227
|
+
/** 错误扩展码 */
|
|
119
228
|
errorCode: string | number
|
|
229
|
+
/** 错误扩展信息 */
|
|
120
230
|
errorMsg: string
|
|
121
231
|
}
|
|
122
232
|
}) => void
|
|
123
233
|
}): void
|
|
124
234
|
|
|
125
235
|
/**
|
|
126
|
-
*
|
|
236
|
+
* download file
|
|
237
|
+
* @public
|
|
238
|
+
* @since P2PKit 1.0.0
|
|
239
|
+
* @platform iOS Android
|
|
127
240
|
*/
|
|
128
241
|
export function downloadFile(params: {
|
|
129
|
-
/**
|
|
242
|
+
/**
|
|
243
|
+
* device id
|
|
244
|
+
* @since P2PKit 1.0.0
|
|
245
|
+
*/
|
|
130
246
|
deviceId: string
|
|
131
|
-
/**
|
|
247
|
+
/**
|
|
248
|
+
* albumName given by the device
|
|
249
|
+
* @since P2PKit 1.0.0
|
|
250
|
+
*/
|
|
132
251
|
albumName: string
|
|
133
|
-
/**
|
|
252
|
+
/**
|
|
253
|
+
* local file path
|
|
254
|
+
* @since P2PKit 1.0.0
|
|
255
|
+
*/
|
|
134
256
|
filePath: string
|
|
135
|
-
/**
|
|
257
|
+
/**
|
|
258
|
+
* file name jsons,eg: {"files":["filesname1", "filesname2", "filesname3" ]}
|
|
259
|
+
* @since P2PKit 1.0.0
|
|
260
|
+
*/
|
|
136
261
|
jsonfiles: string
|
|
262
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
137
263
|
complete?: () => void
|
|
264
|
+
/** 接口调用成功的回调函数 */
|
|
138
265
|
success?: (params: null) => void
|
|
266
|
+
/** 接口调用失败的回调函数 */
|
|
139
267
|
fail?: (params: {
|
|
268
|
+
/** 错误信息 */
|
|
140
269
|
errorMsg: string
|
|
270
|
+
/** 错误码 */
|
|
141
271
|
errorCode: string | number
|
|
272
|
+
/** 错误扩展 */
|
|
142
273
|
innerError: {
|
|
274
|
+
/** 错误扩展码 */
|
|
143
275
|
errorCode: string | number
|
|
276
|
+
/** 错误扩展信息 */
|
|
144
277
|
errorMsg: string
|
|
145
278
|
}
|
|
146
279
|
}) => void
|
|
147
280
|
}): void
|
|
148
281
|
|
|
149
282
|
/**
|
|
150
|
-
*
|
|
283
|
+
* download file stream
|
|
284
|
+
* @public
|
|
285
|
+
* @since P2PKit 2.0.2
|
|
286
|
+
* @platform iOS Android
|
|
151
287
|
*/
|
|
152
288
|
export function downloadStream(params: {
|
|
153
|
-
/**
|
|
289
|
+
/**
|
|
290
|
+
* device id
|
|
291
|
+
* @since P2PKit 2.0.2
|
|
292
|
+
*/
|
|
154
293
|
deviceId: string
|
|
155
|
-
/**
|
|
294
|
+
/**
|
|
295
|
+
* albumName given by the device
|
|
296
|
+
* @since P2PKit 2.0.2
|
|
297
|
+
*/
|
|
156
298
|
albumName: string
|
|
157
|
-
/**
|
|
299
|
+
/**
|
|
300
|
+
* file name jsons,eg: {"files":["filesname1", "filesname2", "filesname3" ]}
|
|
301
|
+
* @since P2PKit 2.0.2
|
|
302
|
+
*/
|
|
158
303
|
jsonfiles: string
|
|
304
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
159
305
|
complete?: () => void
|
|
306
|
+
/** 接口调用成功的回调函数 */
|
|
160
307
|
success?: (params: null) => void
|
|
308
|
+
/** 接口调用失败的回调函数 */
|
|
161
309
|
fail?: (params: {
|
|
310
|
+
/** 错误信息 */
|
|
162
311
|
errorMsg: string
|
|
312
|
+
/** 错误码 */
|
|
163
313
|
errorCode: string | number
|
|
314
|
+
/** 错误扩展 */
|
|
164
315
|
innerError: {
|
|
316
|
+
/** 错误扩展码 */
|
|
165
317
|
errorCode: string | number
|
|
318
|
+
/** 错误扩展信息 */
|
|
166
319
|
errorMsg: string
|
|
167
320
|
}
|
|
168
321
|
}) => void
|
|
169
322
|
}): void
|
|
170
323
|
|
|
171
324
|
/**
|
|
172
|
-
*
|
|
325
|
+
* append download file stream
|
|
326
|
+
* @public
|
|
327
|
+
* @since P2PKit 2.1.0
|
|
328
|
+
* @platform iOS Android
|
|
173
329
|
*/
|
|
174
330
|
export function appendDownloadStream(params: {
|
|
175
|
-
/**
|
|
331
|
+
/**
|
|
332
|
+
* device id
|
|
333
|
+
* @since P2PKit 2.1.0
|
|
334
|
+
*/
|
|
176
335
|
deviceId: string
|
|
177
|
-
/**
|
|
336
|
+
/**
|
|
337
|
+
* albumName given by the device
|
|
338
|
+
* @since P2PKit 2.1.0
|
|
339
|
+
*/
|
|
178
340
|
albumName: string
|
|
179
|
-
/**
|
|
341
|
+
/**
|
|
342
|
+
* file name jsons,eg: {"files":["filesname1", "filesname2", "filesname3" ]}
|
|
343
|
+
* @since P2PKit 2.1.0
|
|
344
|
+
*/
|
|
180
345
|
jsonfiles: string
|
|
346
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
181
347
|
complete?: () => void
|
|
348
|
+
/** 接口调用成功的回调函数 */
|
|
182
349
|
success?: (params: null) => void
|
|
350
|
+
/** 接口调用失败的回调函数 */
|
|
183
351
|
fail?: (params: {
|
|
352
|
+
/** 错误信息 */
|
|
184
353
|
errorMsg: string
|
|
354
|
+
/** 错误码 */
|
|
185
355
|
errorCode: string | number
|
|
356
|
+
/** 错误扩展 */
|
|
186
357
|
innerError: {
|
|
358
|
+
/** 错误扩展码 */
|
|
187
359
|
errorCode: string | number
|
|
360
|
+
/** 错误扩展信息 */
|
|
188
361
|
errorMsg: string
|
|
189
362
|
}
|
|
190
363
|
}) => void
|
|
191
364
|
}): void
|
|
192
365
|
|
|
193
366
|
/**
|
|
194
|
-
*
|
|
367
|
+
* cancel upload task
|
|
368
|
+
* @public
|
|
369
|
+
* @since P2PKit 0.0.1
|
|
370
|
+
* @platform iOS Android
|
|
195
371
|
*/
|
|
196
372
|
export function cancelUploadTask(params: {
|
|
197
|
-
/**
|
|
373
|
+
/**
|
|
374
|
+
* device id
|
|
375
|
+
* @since P2PKit 0.0.1
|
|
376
|
+
*/
|
|
198
377
|
deviceId: string
|
|
378
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
199
379
|
complete?: () => void
|
|
380
|
+
/** 接口调用成功的回调函数 */
|
|
200
381
|
success?: (params: null) => void
|
|
382
|
+
/** 接口调用失败的回调函数 */
|
|
201
383
|
fail?: (params: {
|
|
384
|
+
/** 错误信息 */
|
|
202
385
|
errorMsg: string
|
|
386
|
+
/** 错误码 */
|
|
203
387
|
errorCode: string | number
|
|
388
|
+
/** 错误扩展 */
|
|
204
389
|
innerError: {
|
|
390
|
+
/** 错误扩展码 */
|
|
205
391
|
errorCode: string | number
|
|
392
|
+
/** 错误扩展信息 */
|
|
206
393
|
errorMsg: string
|
|
207
394
|
}
|
|
208
395
|
}) => void
|
|
209
396
|
}): void
|
|
210
397
|
|
|
211
398
|
/**
|
|
212
|
-
*
|
|
399
|
+
* cancel download task
|
|
400
|
+
* @public
|
|
401
|
+
* @since P2PKit 1.0.0
|
|
402
|
+
* @platform iOS Android
|
|
213
403
|
*/
|
|
214
404
|
export function cancelDownloadTask(params: {
|
|
215
|
-
/**
|
|
405
|
+
/**
|
|
406
|
+
* device id
|
|
407
|
+
* @since P2PKit 1.0.0
|
|
408
|
+
*/
|
|
216
409
|
deviceId: string
|
|
410
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
217
411
|
complete?: () => void
|
|
412
|
+
/** 接口调用成功的回调函数 */
|
|
218
413
|
success?: (params: null) => void
|
|
414
|
+
/** 接口调用失败的回调函数 */
|
|
219
415
|
fail?: (params: {
|
|
416
|
+
/** 错误信息 */
|
|
220
417
|
errorMsg: string
|
|
418
|
+
/** 错误码 */
|
|
221
419
|
errorCode: string | number
|
|
420
|
+
/** 错误扩展 */
|
|
222
421
|
innerError: {
|
|
422
|
+
/** 错误扩展码 */
|
|
223
423
|
errorCode: string | number
|
|
424
|
+
/** 错误扩展信息 */
|
|
224
425
|
errorMsg: string
|
|
225
426
|
}
|
|
226
427
|
}) => void
|
|
227
428
|
}): void
|
|
228
429
|
|
|
229
430
|
/**
|
|
230
|
-
*
|
|
431
|
+
* P2P disconnect
|
|
432
|
+
* @public
|
|
433
|
+
* @since P2PKit 0.0.1
|
|
434
|
+
* @platform iOS Android
|
|
231
435
|
*/
|
|
232
436
|
export function disconnectDevice(params: {
|
|
233
|
-
/**
|
|
437
|
+
/**
|
|
438
|
+
* device id
|
|
439
|
+
* @since P2PKit 0.0.1
|
|
440
|
+
*/
|
|
234
441
|
deviceId: string
|
|
442
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
235
443
|
complete?: () => void
|
|
444
|
+
/** 接口调用成功的回调函数 */
|
|
236
445
|
success?: (params: null) => void
|
|
446
|
+
/** 接口调用失败的回调函数 */
|
|
237
447
|
fail?: (params: {
|
|
448
|
+
/** 错误信息 */
|
|
238
449
|
errorMsg: string
|
|
450
|
+
/** 错误码 */
|
|
239
451
|
errorCode: string | number
|
|
452
|
+
/** 错误扩展 */
|
|
240
453
|
innerError: {
|
|
454
|
+
/** 错误扩展码 */
|
|
241
455
|
errorCode: string | number
|
|
456
|
+
/** 错误扩展信息 */
|
|
242
457
|
errorMsg: string
|
|
243
458
|
}
|
|
244
459
|
}) => void
|
|
245
460
|
}): void
|
|
246
461
|
|
|
247
462
|
/**
|
|
248
|
-
* P2P SDK
|
|
463
|
+
* P2P SDK deinit
|
|
464
|
+
* @public
|
|
465
|
+
* @since P2PKit 0.0.1
|
|
466
|
+
* @platform iOS Android
|
|
249
467
|
*/
|
|
250
468
|
export function deInitSDK(params?: {
|
|
469
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
251
470
|
complete?: () => void
|
|
471
|
+
/** 接口调用成功的回调函数 */
|
|
252
472
|
success?: (params: null) => void
|
|
473
|
+
/** 接口调用失败的回调函数 */
|
|
253
474
|
fail?: (params: {
|
|
475
|
+
/** 错误信息 */
|
|
254
476
|
errorMsg: string
|
|
477
|
+
/** 错误码 */
|
|
255
478
|
errorCode: string | number
|
|
479
|
+
/** 错误扩展 */
|
|
256
480
|
innerError: {
|
|
481
|
+
/** 错误扩展码 */
|
|
257
482
|
errorCode: string | number
|
|
483
|
+
/** 错误扩展信息 */
|
|
258
484
|
errorMsg: string
|
|
259
485
|
}
|
|
260
486
|
}) => void
|
|
261
487
|
}): void
|
|
262
488
|
|
|
263
489
|
/**
|
|
264
|
-
*
|
|
490
|
+
* P2P status changed event
|
|
491
|
+
* @public
|
|
492
|
+
* @since P2PKit 1.0.0
|
|
493
|
+
* @platform iOS Android
|
|
265
494
|
*/
|
|
266
|
-
export function onSessionStatusChange(
|
|
495
|
+
export function onSessionStatusChange(
|
|
496
|
+
listener: (params: ThingP2PSessionStatus) => void
|
|
497
|
+
): void
|
|
267
498
|
|
|
268
499
|
/**
|
|
269
|
-
*
|
|
500
|
+
* P2P status changed event
|
|
501
|
+
* @public
|
|
502
|
+
* @since P2PKit 1.0.0
|
|
503
|
+
* @platform iOS Android
|
|
270
504
|
*/
|
|
271
|
-
export function offSessionStatusChange(
|
|
505
|
+
export function offSessionStatusChange(
|
|
506
|
+
listener: (params: ThingP2PSessionStatus) => void
|
|
507
|
+
): void
|
|
272
508
|
|
|
273
509
|
/**
|
|
274
|
-
*
|
|
510
|
+
* upload file progress event
|
|
511
|
+
* @public
|
|
512
|
+
* @since P2PKit 0.0.1
|
|
513
|
+
* @platform iOS Android
|
|
275
514
|
*/
|
|
276
|
-
export function onUploadProgressUpdate(
|
|
515
|
+
export function onUploadProgressUpdate(
|
|
516
|
+
listener: (params: ProgressEvent) => void
|
|
517
|
+
): void
|
|
277
518
|
|
|
278
519
|
/**
|
|
279
|
-
*
|
|
520
|
+
* upload file progress event
|
|
521
|
+
* @public
|
|
522
|
+
* @since P2PKit 0.0.1
|
|
523
|
+
* @platform iOS Android
|
|
280
524
|
*/
|
|
281
|
-
export function offUploadProgressUpdate(
|
|
525
|
+
export function offUploadProgressUpdate(
|
|
526
|
+
listener: (params: ProgressEvent) => void
|
|
527
|
+
): void
|
|
282
528
|
|
|
283
529
|
/**
|
|
284
|
-
*
|
|
530
|
+
* single file download progress event
|
|
531
|
+
* @public
|
|
532
|
+
* @since P2PKit 1.0.0
|
|
533
|
+
* @platform iOS Android
|
|
285
534
|
*/
|
|
286
|
-
export function onDownloadProgressUpdate(
|
|
535
|
+
export function onDownloadProgressUpdate(
|
|
536
|
+
listener: (params: DownloadProgressEvent) => void
|
|
537
|
+
): void
|
|
287
538
|
|
|
288
539
|
/**
|
|
289
|
-
*
|
|
540
|
+
* single file download progress event
|
|
541
|
+
* @public
|
|
542
|
+
* @since P2PKit 1.0.0
|
|
543
|
+
* @platform iOS Android
|
|
290
544
|
*/
|
|
291
|
-
export function offDownloadProgressUpdate(
|
|
545
|
+
export function offDownloadProgressUpdate(
|
|
546
|
+
listener: (params: DownloadProgressEvent) => void
|
|
547
|
+
): void
|
|
292
548
|
|
|
293
549
|
/**
|
|
294
|
-
*
|
|
550
|
+
* total download progress event
|
|
551
|
+
* @public
|
|
552
|
+
* @since P2PKit 1.0.0
|
|
553
|
+
* @platform iOS Android
|
|
295
554
|
*/
|
|
296
555
|
export function onDownloadTotalProgressUpdate(
|
|
297
556
|
listener: (params: DownloadTotalProgressEvent) => void
|
|
298
557
|
): void
|
|
299
558
|
|
|
300
559
|
/**
|
|
301
|
-
*
|
|
560
|
+
* total download progress event
|
|
561
|
+
* @public
|
|
562
|
+
* @since P2PKit 1.0.0
|
|
563
|
+
* @platform iOS Android
|
|
302
564
|
*/
|
|
303
565
|
export function offDownloadTotalProgressUpdate(
|
|
304
566
|
listener: (params: DownloadTotalProgressEvent) => void
|
|
305
567
|
): void
|
|
306
568
|
|
|
307
569
|
/**
|
|
308
|
-
*
|
|
570
|
+
* single file download completed event
|
|
571
|
+
* @public
|
|
572
|
+
* @since P2PKit 1.0.0
|
|
573
|
+
* @platform iOS Android
|
|
309
574
|
*/
|
|
310
575
|
export function onFileDownloadComplete(
|
|
311
576
|
listener: (params: FileDownloadCompletionEvent) => void
|
|
312
577
|
): void
|
|
313
578
|
|
|
314
579
|
/**
|
|
315
|
-
*
|
|
580
|
+
* single file download completed event
|
|
581
|
+
* @public
|
|
582
|
+
* @since P2PKit 1.0.0
|
|
583
|
+
* @platform iOS Android
|
|
316
584
|
*/
|
|
317
585
|
export function offFileDownloadComplete(
|
|
318
586
|
listener: (params: FileDownloadCompletionEvent) => void
|
|
319
587
|
): void
|
|
320
588
|
|
|
321
589
|
/**
|
|
322
|
-
*
|
|
590
|
+
* download packet received event
|
|
591
|
+
* @public
|
|
592
|
+
* @since P2PKit 2.0.2
|
|
593
|
+
* @platform iOS Android
|
|
323
594
|
*/
|
|
324
595
|
export function onStreamPacketReceive(
|
|
325
596
|
listener: (params: StreamDownloadPacketReceivedEvent) => void
|
|
326
597
|
): void
|
|
327
598
|
|
|
328
599
|
/**
|
|
329
|
-
*
|
|
600
|
+
* download packet received event
|
|
601
|
+
* @public
|
|
602
|
+
* @since P2PKit 2.0.2
|
|
603
|
+
* @platform iOS Android
|
|
330
604
|
*/
|
|
331
605
|
export function offStreamPacketReceive(
|
|
332
606
|
listener: (params: StreamDownloadPacketReceivedEvent) => void
|
|
333
607
|
): void
|
|
334
608
|
|
|
335
|
-
|
|
336
|
-
|
|
609
|
+
/** @since P2PKit 2.0.0 */
|
|
610
|
+
export interface ThingP2PInitConfigParams {
|
|
611
|
+
/**
|
|
612
|
+
* user id
|
|
613
|
+
* @since P2PKit 2.0.0
|
|
614
|
+
*/
|
|
615
|
+
userId?: string
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/** @since P2PKit 2.0.0 */
|
|
619
|
+
export interface ThingP2PConnectionParams {
|
|
620
|
+
/**
|
|
621
|
+
* device id
|
|
622
|
+
* @since P2PKit 2.0.3
|
|
623
|
+
*/
|
|
337
624
|
deviceId: string
|
|
338
|
-
/**
|
|
625
|
+
/**
|
|
626
|
+
* connect mode,0:INTERNET 1:LAN
|
|
627
|
+
* @since P2PKit 2.0.3
|
|
628
|
+
* @defaultValue 0
|
|
629
|
+
*/
|
|
339
630
|
mode?: number
|
|
340
|
-
/**
|
|
631
|
+
/**
|
|
632
|
+
* timeout,unit:ms, default as Internet:15000ms,Lan:3000ms
|
|
633
|
+
* @since P2PKit 2.0.3
|
|
634
|
+
* @defaultValue 0
|
|
635
|
+
*/
|
|
341
636
|
timeout?: number
|
|
342
637
|
}
|
|
343
638
|
|
|
344
|
-
|
|
345
|
-
|
|
639
|
+
/** @since P2PKit 2.0.0 */
|
|
640
|
+
export interface ThingP2PAlbum {
|
|
641
|
+
/**
|
|
642
|
+
* device id
|
|
643
|
+
* @since P2PKit 2.0.0
|
|
644
|
+
*/
|
|
645
|
+
deviceId: string
|
|
646
|
+
/**
|
|
647
|
+
* albumName,given by the device
|
|
648
|
+
* @since P2PKit 2.0.0
|
|
649
|
+
*/
|
|
650
|
+
albumName: string
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
/** @since P2PKit 2.0.0 */
|
|
654
|
+
export interface ThingP2PAlbumFileIndex {
|
|
655
|
+
/**
|
|
656
|
+
* idx,given by the device
|
|
657
|
+
* @since P2PKit 2.0.2
|
|
658
|
+
*/
|
|
346
659
|
idx: number
|
|
347
|
-
/**
|
|
660
|
+
/**
|
|
661
|
+
* channel channel number
|
|
662
|
+
* @since P2PKit 2.0.2
|
|
663
|
+
*/
|
|
348
664
|
channel: number
|
|
349
|
-
/**
|
|
665
|
+
/**
|
|
666
|
+
* type file type,0: image,2: mp4, 3: Panoramic stitching file
|
|
667
|
+
* @since P2PKit 2.0.2
|
|
668
|
+
*/
|
|
350
669
|
type: number
|
|
351
|
-
/**
|
|
670
|
+
/**
|
|
671
|
+
* dir 0: file,1: directory
|
|
672
|
+
* @since P2PKit 2.0.2
|
|
673
|
+
*/
|
|
352
674
|
dir: number
|
|
353
|
-
/**
|
|
675
|
+
/**
|
|
676
|
+
* file name contains suffix
|
|
677
|
+
* @since P2PKit 2.0.2
|
|
678
|
+
*/
|
|
354
679
|
filename: string
|
|
355
|
-
/**
|
|
680
|
+
/**
|
|
681
|
+
* createTime file create time
|
|
682
|
+
* @since P2PKit 2.0.2
|
|
683
|
+
*/
|
|
356
684
|
createTime: number
|
|
357
|
-
/**
|
|
685
|
+
/**
|
|
686
|
+
* duration file duration
|
|
687
|
+
* @since P2PKit 2.0.2
|
|
688
|
+
*/
|
|
358
689
|
duration: number
|
|
359
690
|
}
|
|
360
691
|
|
|
361
|
-
|
|
362
|
-
|
|
692
|
+
/** @since P2PKit 2.0.0 */
|
|
693
|
+
export interface ThingP2PAlbumFileIndexs {
|
|
694
|
+
/**
|
|
695
|
+
* file count
|
|
696
|
+
* @since P2PKit 2.0.0
|
|
697
|
+
*/
|
|
698
|
+
count: number
|
|
699
|
+
/**
|
|
700
|
+
* file index infos
|
|
701
|
+
* @since P2PKit 2.0.0
|
|
702
|
+
*/
|
|
703
|
+
items: ThingP2PAlbumFileIndex[]
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/** @since P2PKit 2.0.0 */
|
|
707
|
+
export interface ThingP2PUploadFile {
|
|
708
|
+
/**
|
|
709
|
+
* device id
|
|
710
|
+
* @since P2PKit 2.0.0
|
|
711
|
+
*/
|
|
712
|
+
deviceId: string
|
|
713
|
+
/**
|
|
714
|
+
* albumName given by the device
|
|
715
|
+
* @since P2PKit 2.0.0
|
|
716
|
+
*/
|
|
717
|
+
albumName: string
|
|
718
|
+
/**
|
|
719
|
+
* local file path
|
|
720
|
+
* @since P2PKit 2.0.0
|
|
721
|
+
*/
|
|
722
|
+
filePath: string
|
|
723
|
+
/**
|
|
724
|
+
* ext data
|
|
725
|
+
* @since P2PKit 2.0.0
|
|
726
|
+
*/
|
|
727
|
+
extData?: string
|
|
728
|
+
/**
|
|
729
|
+
* ext data length
|
|
730
|
+
* @since P2PKit 2.0.0
|
|
731
|
+
*/
|
|
732
|
+
extDataLength?: number
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/** @since P2PKit 2.0.0 */
|
|
736
|
+
export interface ThingP2PDownloadFile {
|
|
737
|
+
/**
|
|
738
|
+
* device id
|
|
739
|
+
* @since P2PKit 2.0.0
|
|
740
|
+
*/
|
|
363
741
|
deviceId: string
|
|
364
|
-
/**
|
|
742
|
+
/**
|
|
743
|
+
* albumName given by the device
|
|
744
|
+
* @since P2PKit 2.0.0
|
|
745
|
+
*/
|
|
746
|
+
albumName: string
|
|
747
|
+
/**
|
|
748
|
+
* local file path
|
|
749
|
+
* @since P2PKit 2.0.0
|
|
750
|
+
*/
|
|
751
|
+
filePath: string
|
|
752
|
+
/**
|
|
753
|
+
* file name jsons,eg: {"files":["filesname1", "filesname2", "filesname3" ]}
|
|
754
|
+
* @since P2PKit 2.0.0
|
|
755
|
+
*/
|
|
756
|
+
jsonfiles: string
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/** @since P2PKit 2.0.2 */
|
|
760
|
+
export interface ThingP2PDownloadStream {
|
|
761
|
+
/**
|
|
762
|
+
* device id
|
|
763
|
+
* @since P2PKit 2.0.2
|
|
764
|
+
*/
|
|
765
|
+
deviceId: string
|
|
766
|
+
/**
|
|
767
|
+
* albumName given by the device
|
|
768
|
+
* @since P2PKit 2.0.2
|
|
769
|
+
*/
|
|
770
|
+
albumName: string
|
|
771
|
+
/**
|
|
772
|
+
* file name jsons,eg: {"files":["filesname1", "filesname2", "filesname3" ]}
|
|
773
|
+
* @since P2PKit 2.0.2
|
|
774
|
+
*/
|
|
775
|
+
jsonfiles: string
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/** @since P2PKit 2.0.0 */
|
|
779
|
+
export interface ThingP2PSessionStatus {
|
|
780
|
+
/**
|
|
781
|
+
* device id
|
|
782
|
+
* @since P2PKit 2.0.0
|
|
783
|
+
*/
|
|
784
|
+
deviceId: string
|
|
785
|
+
/**
|
|
786
|
+
* status, status < 0 means disconnected
|
|
787
|
+
* @since P2PKit 2.0.0
|
|
788
|
+
*/
|
|
365
789
|
status: number
|
|
366
790
|
}
|
|
367
791
|
|
|
368
|
-
|
|
369
|
-
|
|
792
|
+
/** @since P2PKit 0.0.1 */
|
|
793
|
+
export interface ProgressEvent {
|
|
794
|
+
/**
|
|
795
|
+
* device id
|
|
796
|
+
* @since P2PKit 0.0.1
|
|
797
|
+
*/
|
|
370
798
|
deviceId: string
|
|
371
|
-
/**
|
|
799
|
+
/**
|
|
800
|
+
* local file path
|
|
801
|
+
* @since P2PKit 0.0.1
|
|
802
|
+
*/
|
|
372
803
|
filePath: string
|
|
373
|
-
/**
|
|
804
|
+
/**
|
|
805
|
+
* upload/download progress
|
|
806
|
+
* @since P2PKit 0.0.1
|
|
807
|
+
*/
|
|
374
808
|
progress: number
|
|
375
809
|
}
|
|
376
810
|
|
|
377
|
-
|
|
378
|
-
|
|
811
|
+
/** @since P2PKit 1.0.0 */
|
|
812
|
+
export interface DownloadProgressEvent {
|
|
813
|
+
/**
|
|
814
|
+
* device id
|
|
815
|
+
* @since P2PKit 1.0.0
|
|
816
|
+
*/
|
|
379
817
|
deviceId: string
|
|
380
|
-
/**
|
|
818
|
+
/**
|
|
819
|
+
* file name on downloading
|
|
820
|
+
* @since P2PKit 1.0.0
|
|
821
|
+
*/
|
|
381
822
|
fileName: string
|
|
382
|
-
/**
|
|
823
|
+
/**
|
|
824
|
+
* upload/download progress
|
|
825
|
+
* @since P2PKit 1.0.0
|
|
826
|
+
*/
|
|
383
827
|
progress: number
|
|
384
828
|
}
|
|
385
829
|
|
|
386
|
-
|
|
387
|
-
|
|
830
|
+
/** @since P2PKit 1.0.0 */
|
|
831
|
+
export interface DownloadTotalProgressEvent {
|
|
832
|
+
/**
|
|
833
|
+
* device id
|
|
834
|
+
* @since P2PKit 1.0.0
|
|
835
|
+
*/
|
|
388
836
|
deviceId: string
|
|
389
|
-
/**
|
|
837
|
+
/**
|
|
838
|
+
* upload/download progress
|
|
839
|
+
* @since P2PKit 1.0.0
|
|
840
|
+
*/
|
|
390
841
|
progress: number
|
|
391
842
|
}
|
|
392
843
|
|
|
393
|
-
|
|
394
|
-
|
|
844
|
+
/** @since P2PKit 1.0.0 */
|
|
845
|
+
export interface FileDownloadCompletionEvent {
|
|
846
|
+
/**
|
|
847
|
+
* device id
|
|
848
|
+
* @since P2PKit 1.0.0
|
|
849
|
+
*/
|
|
395
850
|
deviceId: string
|
|
396
|
-
/**
|
|
851
|
+
/**
|
|
852
|
+
* file name
|
|
853
|
+
* @since P2PKit 1.0.0
|
|
854
|
+
*/
|
|
397
855
|
fileName: string
|
|
398
|
-
/**
|
|
856
|
+
/**
|
|
857
|
+
* index
|
|
858
|
+
* @since P2PKit 1.0.0
|
|
859
|
+
*/
|
|
399
860
|
index: number
|
|
400
861
|
}
|
|
401
862
|
|
|
402
|
-
|
|
403
|
-
|
|
863
|
+
/** @since P2PKit 2.0.2 */
|
|
864
|
+
export interface StreamDownloadPacketReceivedEvent {
|
|
865
|
+
/**
|
|
866
|
+
* device id
|
|
867
|
+
* @since P2PKit 2.0.2
|
|
868
|
+
*/
|
|
404
869
|
deviceId: string
|
|
405
|
-
/**
|
|
870
|
+
/**
|
|
871
|
+
* total files count
|
|
872
|
+
* @since P2PKit 2.0.2
|
|
873
|
+
*/
|
|
406
874
|
totalFiles: number
|
|
407
|
-
/**
|
|
875
|
+
/**
|
|
876
|
+
* file name
|
|
877
|
+
* @since P2PKit 2.0.2
|
|
878
|
+
*/
|
|
408
879
|
fileName: string
|
|
409
|
-
/**
|
|
880
|
+
/**
|
|
881
|
+
* file index, dirty data
|
|
882
|
+
* @since P2PKit 2.0.2
|
|
883
|
+
*/
|
|
410
884
|
fileIndex: number
|
|
411
|
-
/**
|
|
885
|
+
/**
|
|
886
|
+
* file length
|
|
887
|
+
* @since P2PKit 2.0.2
|
|
888
|
+
*/
|
|
412
889
|
fileLength: number
|
|
413
|
-
/**
|
|
890
|
+
/**
|
|
891
|
+
* packet data
|
|
892
|
+
* @since P2PKit 2.0.2
|
|
893
|
+
*/
|
|
414
894
|
packetData: string
|
|
415
|
-
/**
|
|
895
|
+
/**
|
|
896
|
+
* packet data length
|
|
897
|
+
* @since P2PKit 2.0.2
|
|
898
|
+
*/
|
|
416
899
|
packetLength: number
|
|
417
|
-
/**
|
|
900
|
+
/**
|
|
901
|
+
* file serial number
|
|
902
|
+
* @since P2PKit 2.0.2
|
|
903
|
+
*/
|
|
418
904
|
fileSerialNumber: number
|
|
419
|
-
/**
|
|
905
|
+
/**
|
|
906
|
+
* packet index
|
|
907
|
+
* @since P2PKit 2.0.2
|
|
908
|
+
*/
|
|
420
909
|
packetIndex: number
|
|
421
|
-
/**
|
|
910
|
+
/**
|
|
911
|
+
* packet header/packet tail 0b00XY Y:packet header X:packet tail
|
|
912
|
+
* @since P2PKit 2.0.2
|
|
913
|
+
*/
|
|
422
914
|
packetType: number
|
|
423
915
|
}
|
|
916
|
+
|
|
917
|
+
/** @since P2PKit 2.0.0 */
|
|
918
|
+
export interface ThingP2PUploadTask {
|
|
919
|
+
/**
|
|
920
|
+
* device id
|
|
921
|
+
* @since P2PKit 2.0.0
|
|
922
|
+
*/
|
|
923
|
+
deviceId: string
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/** @since P2PKit 2.0.0 */
|
|
927
|
+
export interface ThingP2PDownloadTask {
|
|
928
|
+
/**
|
|
929
|
+
* device id
|
|
930
|
+
* @since P2PKit 2.0.0
|
|
931
|
+
*/
|
|
932
|
+
deviceId: string
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/** @since P2PKit 2.0.0 */
|
|
936
|
+
export interface ThingP2PDevice {
|
|
937
|
+
/**
|
|
938
|
+
* device id
|
|
939
|
+
* @since P2PKit 2.0.0
|
|
940
|
+
*/
|
|
941
|
+
deviceId: string
|
|
942
|
+
}
|
|
424
943
|
}
|