@ray-js/api 1.7.80 → 1.7.82

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.
@@ -1,13 +1,25 @@
1
1
  /**
2
2
  * P2PKit
3
3
  *
4
- * @version 7.7.5
4
+ * @version 7.9.0
5
5
  */
6
6
  declare namespace ty.p2p {
7
7
  /**
8
8
  * P2P SDK init
9
9
  * @public
10
10
  * @since P2PKit 0.0.1
11
+ * @example Demo
12
+ * ```tsx
13
+ * ty.p2p.P2PSDKInit({
14
+ * userId: "xx",
15
+ * success: data => {
16
+ * console.log(data);
17
+ * },
18
+ * fail: error => {
19
+ * console.error(error);
20
+ * },
21
+ * });
22
+ * ```
11
23
  * @platform iOS Android
12
24
  */
13
25
  export function P2PSDKInit(params?: {
@@ -16,11 +28,11 @@ declare namespace ty.p2p {
16
28
  * @since P2PKit 0.0.1
17
29
  */
18
30
  userId?: string
19
- /** complete 完成回调(成功、失败都会触发) */
31
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
20
32
  complete?: () => void
21
- /** success 成功回调 */
22
- success?: (params: null) => void
23
- /** fail 失败回调 */
33
+ /** 接口调用成功的回调函数 */
34
+ success?: () => void
35
+ /** 接口调用失败的回调函数 */
24
36
  fail?: (params: {
25
37
  /** 错误信息 */
26
38
  errorMsg: string
@@ -40,34 +52,45 @@ declare namespace ty.p2p {
40
52
  * P2P connect
41
53
  * @public
42
54
  * @since P2PKit 0.0.1
55
+ * @example Demo
56
+ * ```tsx
57
+ * ty.p2p.connectDevice({
58
+ * deviceId: "xx",
59
+ * mode: 0,
60
+ * timeout: 0,
61
+ * success: data => {
62
+ * console.log(data);
63
+ * },
64
+ * fail: error => {
65
+ * console.error(error);
66
+ * },
67
+ * });
68
+ * ```
43
69
  * @platform iOS Android
44
70
  */
45
71
  export function connectDevice(params: {
46
72
  /**
47
73
  * device id
48
74
  * @since P2PKit 0.0.1
49
- * @since P2PKit 2.0.3
50
75
  */
51
76
  deviceId: string
52
77
  /**
53
78
  * connect mode,0:INTERNET 1:LAN
54
79
  * @since P2PKit 0.0.1
55
- * @since P2PKit 2.0.3
56
80
  * @defaultValue 0
57
81
  */
58
82
  mode?: number
59
83
  /**
60
84
  * timeout,unit:ms, default as Internet:15000ms,Lan:3000ms
61
85
  * @since P2PKit 0.0.1
62
- * @since P2PKit 2.0.3
63
86
  * @defaultValue 0
64
87
  */
65
88
  timeout?: number
66
- /** complete 完成回调(成功、失败都会触发) */
89
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
67
90
  complete?: () => void
68
- /** success 成功回调 */
69
- success?: (params: null) => void
70
- /** fail 失败回调 */
91
+ /** 接口调用成功的回调函数 */
92
+ success?: () => void
93
+ /** 接口调用失败的回调函数 */
71
94
  fail?: (params: {
72
95
  /** 错误信息 */
73
96
  errorMsg: string
@@ -87,34 +110,45 @@ declare namespace ty.p2p {
87
110
  * check P2P status
88
111
  * @public
89
112
  * @since P2PKit 2.0.3
113
+ * @example Demo
114
+ * ```tsx
115
+ * ty.p2p.isP2PActive({
116
+ * deviceId: "xx",
117
+ * mode: 0,
118
+ * timeout: 0,
119
+ * success: data => {
120
+ * console.log(data);
121
+ * },
122
+ * fail: error => {
123
+ * console.error(error);
124
+ * },
125
+ * });
126
+ * ```
90
127
  * @platform iOS Android
91
128
  */
92
129
  export function isP2PActive(params: {
93
130
  /**
94
131
  * device id
95
- * @since P2PKit 0.0.1
96
132
  * @since P2PKit 2.0.3
97
133
  */
98
134
  deviceId: string
99
135
  /**
100
136
  * connect mode,0:INTERNET 1:LAN
101
- * @since P2PKit 0.0.1
102
137
  * @since P2PKit 2.0.3
103
138
  * @defaultValue 0
104
139
  */
105
140
  mode?: number
106
141
  /**
107
142
  * timeout,unit:ms, default as Internet:15000ms,Lan:3000ms
108
- * @since P2PKit 0.0.1
109
143
  * @since P2PKit 2.0.3
110
144
  * @defaultValue 0
111
145
  */
112
146
  timeout?: number
113
- /** complete 完成回调(成功、失败都会触发) */
147
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
114
148
  complete?: () => void
115
- /** success 成功回调 */
116
- success?: (params: null) => void
117
- /** fail 失败回调 */
149
+ /** 接口调用成功的回调函数 */
150
+ success?: () => void
151
+ /** 接口调用失败的回调函数 */
118
152
  fail?: (params: {
119
153
  /** 错误信息 */
120
154
  errorMsg: string
@@ -134,16 +168,41 @@ declare namespace ty.p2p {
134
168
  * check P2P status
135
169
  * @public
136
170
  * @since P2PKit 2.0.3
171
+ * @example Demo
172
+ * ```tsx
173
+ * ty.p2p.isP2PActive({
174
+ * deviceId: "xx",
175
+ * mode: 0,
176
+ * timeout: 0,
177
+ * success: data => {
178
+ * console.log(data);
179
+ * },
180
+ * fail: error => {
181
+ * console.error(error);
182
+ * },
183
+ * });
184
+ * ```
137
185
  * @platform iOS Android
138
186
  */
139
- export function isP2PActiveSync(
140
- params?: ThingP2PConnectionParams_RLnxyU
141
- ): null
187
+ export function isP2PActiveSync(params?: ThingP2PConnectionParams): null
142
188
 
143
189
  /**
144
190
  * query device's album file index infos
145
191
  * @public
146
192
  * @since P2PKit 1.0.0
193
+ * @example Demo
194
+ * ```tsx
195
+ * ty.p2p.queryAlbumFileIndexs({
196
+ * deviceId: "xx",
197
+ * albumName: "xx",
198
+ * success: data => {
199
+ * console.log(data);
200
+ * },
201
+ * fail: error => {
202
+ * console.error(error);
203
+ * },
204
+ * });
205
+ * ```
147
206
  * @platform iOS Android
148
207
  */
149
208
  export function queryAlbumFileIndexs(params: {
@@ -157,9 +216,9 @@ declare namespace ty.p2p {
157
216
  * @since P2PKit 1.0.0
158
217
  */
159
218
  albumName: string
160
- /** complete 完成回调(成功、失败都会触发) */
219
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
161
220
  complete?: () => void
162
- /** success 成功回调 */
221
+ /** 接口调用成功的回调函数 */
163
222
  success?: (params: {
164
223
  /**
165
224
  * file count
@@ -170,9 +229,9 @@ declare namespace ty.p2p {
170
229
  * file index infos
171
230
  * @since P2PKit 2.0.2
172
231
  */
173
- items: ThingP2PAlbumFileIndex_T9i2P3[]
232
+ items: ThingP2PAlbumFileIndex[]
174
233
  }) => void
175
- /** fail 失败回调 */
234
+ /** 接口调用失败的回调函数 */
176
235
  fail?: (params: {
177
236
  /** 错误信息 */
178
237
  errorMsg: string
@@ -192,6 +251,22 @@ declare namespace ty.p2p {
192
251
  * upload file
193
252
  * @public
194
253
  * @since P2PKit 0.0.1
254
+ * @example Demo
255
+ * ```tsx
256
+ * ty.p2p.uploadFile({
257
+ * deviceId: "xx",
258
+ * albumName: "xx",
259
+ * filePath: "xx",
260
+ * extData: "xx",
261
+ * extDataLength: 1,
262
+ * success: data => {
263
+ * console.log(data);
264
+ * },
265
+ * fail: error => {
266
+ * console.error(error);
267
+ * },
268
+ * });
269
+ * ```
195
270
  * @platform iOS Android
196
271
  */
197
272
  export function uploadFile(params: {
@@ -220,11 +295,11 @@ declare namespace ty.p2p {
220
295
  * @since P2PKit 0.0.1
221
296
  */
222
297
  extDataLength?: number
223
- /** complete 完成回调(成功、失败都会触发) */
298
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
224
299
  complete?: () => void
225
- /** success 成功回调 */
226
- success?: (params: null) => void
227
- /** fail 失败回调 */
300
+ /** 接口调用成功的回调函数 */
301
+ success?: () => void
302
+ /** 接口调用失败的回调函数 */
228
303
  fail?: (params: {
229
304
  /** 错误信息 */
230
305
  errorMsg: string
@@ -244,6 +319,21 @@ declare namespace ty.p2p {
244
319
  * download file
245
320
  * @public
246
321
  * @since P2PKit 1.0.0
322
+ * @example Demo
323
+ * ```tsx
324
+ * ty.p2p.downloadFile({
325
+ * deviceId: "xx",
326
+ * albumName: "xx",
327
+ * filePath: "xx",
328
+ * jsonfiles: "xx",
329
+ * success: data => {
330
+ * console.log(data);
331
+ * },
332
+ * fail: error => {
333
+ * console.error(error);
334
+ * },
335
+ * });
336
+ * ```
247
337
  * @platform iOS Android
248
338
  */
249
339
  export function downloadFile(params: {
@@ -267,11 +357,11 @@ declare namespace ty.p2p {
267
357
  * @since P2PKit 1.0.0
268
358
  */
269
359
  jsonfiles: string
270
- /** complete 完成回调(成功、失败都会触发) */
360
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
271
361
  complete?: () => void
272
- /** success 成功回调 */
273
- success?: (params: null) => void
274
- /** fail 失败回调 */
362
+ /** 接口调用成功的回调函数 */
363
+ success?: () => void
364
+ /** 接口调用失败的回调函数 */
275
365
  fail?: (params: {
276
366
  /** 错误信息 */
277
367
  errorMsg: string
@@ -291,32 +381,43 @@ declare namespace ty.p2p {
291
381
  * download file stream
292
382
  * @public
293
383
  * @since P2PKit 2.0.2
384
+ * @example Demo
385
+ * ```tsx
386
+ * ty.p2p.downloadStream({
387
+ * deviceId: "xx",
388
+ * albumName: "xx",
389
+ * jsonfiles: "xx",
390
+ * success: data => {
391
+ * console.log(data);
392
+ * },
393
+ * fail: error => {
394
+ * console.error(error);
395
+ * },
396
+ * });
397
+ * ```
294
398
  * @platform iOS Android
295
399
  */
296
400
  export function downloadStream(params: {
297
401
  /**
298
402
  * device id
299
403
  * @since P2PKit 2.0.2
300
- * @since P2PKit 2.1.0
301
404
  */
302
405
  deviceId: string
303
406
  /**
304
407
  * albumName given by the device
305
408
  * @since P2PKit 2.0.2
306
- * @since P2PKit 2.1.0
307
409
  */
308
410
  albumName: string
309
411
  /**
310
412
  * file name jsons,eg: {"files":["filesname1", "filesname2", "filesname3" ]}
311
413
  * @since P2PKit 2.0.2
312
- * @since P2PKit 2.1.0
313
414
  */
314
415
  jsonfiles: string
315
- /** complete 完成回调(成功、失败都会触发) */
416
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
316
417
  complete?: () => void
317
- /** success 成功回调 */
318
- success?: (params: null) => void
319
- /** fail 失败回调 */
418
+ /** 接口调用成功的回调函数 */
419
+ success?: () => void
420
+ /** 接口调用失败的回调函数 */
320
421
  fail?: (params: {
321
422
  /** 错误信息 */
322
423
  errorMsg: string
@@ -336,32 +437,43 @@ declare namespace ty.p2p {
336
437
  * append download file stream
337
438
  * @public
338
439
  * @since P2PKit 2.1.0
440
+ * @example Demo
441
+ * ```tsx
442
+ * ty.p2p.appendDownloadStream({
443
+ * deviceId: "xx",
444
+ * albumName: "xx",
445
+ * jsonfiles: "xx",
446
+ * success: data => {
447
+ * console.log(data);
448
+ * },
449
+ * fail: error => {
450
+ * console.error(error);
451
+ * },
452
+ * });
453
+ * ```
339
454
  * @platform iOS Android
340
455
  */
341
456
  export function appendDownloadStream(params: {
342
457
  /**
343
458
  * device id
344
- * @since P2PKit 2.0.2
345
459
  * @since P2PKit 2.1.0
346
460
  */
347
461
  deviceId: string
348
462
  /**
349
463
  * albumName given by the device
350
- * @since P2PKit 2.0.2
351
464
  * @since P2PKit 2.1.0
352
465
  */
353
466
  albumName: string
354
467
  /**
355
468
  * file name jsons,eg: {"files":["filesname1", "filesname2", "filesname3" ]}
356
- * @since P2PKit 2.0.2
357
469
  * @since P2PKit 2.1.0
358
470
  */
359
471
  jsonfiles: string
360
- /** complete 完成回调(成功、失败都会触发) */
472
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
361
473
  complete?: () => void
362
- /** success 成功回调 */
363
- success?: (params: null) => void
364
- /** fail 失败回调 */
474
+ /** 接口调用成功的回调函数 */
475
+ success?: () => void
476
+ /** 接口调用失败的回调函数 */
365
477
  fail?: (params: {
366
478
  /** 错误信息 */
367
479
  errorMsg: string
@@ -381,6 +493,18 @@ declare namespace ty.p2p {
381
493
  * cancel upload task
382
494
  * @public
383
495
  * @since P2PKit 0.0.1
496
+ * @example Demo
497
+ * ```tsx
498
+ * ty.p2p.cancelUploadTask({
499
+ * deviceId: "xx",
500
+ * success: data => {
501
+ * console.log(data);
502
+ * },
503
+ * fail: error => {
504
+ * console.error(error);
505
+ * },
506
+ * });
507
+ * ```
384
508
  * @platform iOS Android
385
509
  */
386
510
  export function cancelUploadTask(params: {
@@ -389,11 +513,11 @@ declare namespace ty.p2p {
389
513
  * @since P2PKit 0.0.1
390
514
  */
391
515
  deviceId: string
392
- /** complete 完成回调(成功、失败都会触发) */
516
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
393
517
  complete?: () => void
394
- /** success 成功回调 */
395
- success?: (params: null) => void
396
- /** fail 失败回调 */
518
+ /** 接口调用成功的回调函数 */
519
+ success?: () => void
520
+ /** 接口调用失败的回调函数 */
397
521
  fail?: (params: {
398
522
  /** 错误信息 */
399
523
  errorMsg: string
@@ -413,6 +537,18 @@ declare namespace ty.p2p {
413
537
  * cancel download task
414
538
  * @public
415
539
  * @since P2PKit 1.0.0
540
+ * @example Demo
541
+ * ```tsx
542
+ * ty.p2p.cancelDownloadTask({
543
+ * deviceId: "xx",
544
+ * success: data => {
545
+ * console.log(data);
546
+ * },
547
+ * fail: error => {
548
+ * console.error(error);
549
+ * },
550
+ * });
551
+ * ```
416
552
  * @platform iOS Android
417
553
  */
418
554
  export function cancelDownloadTask(params: {
@@ -421,11 +557,11 @@ declare namespace ty.p2p {
421
557
  * @since P2PKit 1.0.0
422
558
  */
423
559
  deviceId: string
424
- /** complete 完成回调(成功、失败都会触发) */
560
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
425
561
  complete?: () => void
426
- /** success 成功回调 */
427
- success?: (params: null) => void
428
- /** fail 失败回调 */
562
+ /** 接口调用成功的回调函数 */
563
+ success?: () => void
564
+ /** 接口调用失败的回调函数 */
429
565
  fail?: (params: {
430
566
  /** 错误信息 */
431
567
  errorMsg: string
@@ -445,6 +581,18 @@ declare namespace ty.p2p {
445
581
  * P2P disconnect
446
582
  * @public
447
583
  * @since P2PKit 0.0.1
584
+ * @example Demo
585
+ * ```tsx
586
+ * ty.p2p.disconnectDevice({
587
+ * deviceId: "xx",
588
+ * success: data => {
589
+ * console.log(data);
590
+ * },
591
+ * fail: error => {
592
+ * console.error(error);
593
+ * },
594
+ * });
595
+ * ```
448
596
  * @platform iOS Android
449
597
  */
450
598
  export function disconnectDevice(params: {
@@ -453,11 +601,11 @@ declare namespace ty.p2p {
453
601
  * @since P2PKit 0.0.1
454
602
  */
455
603
  deviceId: string
456
- /** complete 完成回调(成功、失败都会触发) */
604
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
457
605
  complete?: () => void
458
- /** success 成功回调 */
459
- success?: (params: null) => void
460
- /** fail 失败回调 */
606
+ /** 接口调用成功的回调函数 */
607
+ success?: () => void
608
+ /** 接口调用失败的回调函数 */
461
609
  fail?: (params: {
462
610
  /** 错误信息 */
463
611
  errorMsg: string
@@ -477,14 +625,25 @@ declare namespace ty.p2p {
477
625
  * P2P SDK deinit
478
626
  * @public
479
627
  * @since P2PKit 0.0.1
628
+ * @example Demo
629
+ * ```tsx
630
+ * ty.p2p.deInitSDK({
631
+ * success: data => {
632
+ * console.log(data);
633
+ * },
634
+ * fail: error => {
635
+ * console.error(error);
636
+ * },
637
+ * });
638
+ * ```
480
639
  * @platform iOS Android
481
640
  */
482
641
  export function deInitSDK(params?: {
483
- /** complete 完成回调(成功、失败都会触发) */
642
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
484
643
  complete?: () => void
485
- /** success 成功回调 */
486
- success?: (params: null) => void
487
- /** fail 失败回调 */
644
+ /** 接口调用成功的回调函数 */
645
+ success?: () => void
646
+ /** 接口调用失败的回调函数 */
488
647
  fail?: (params: {
489
648
  /** 错误信息 */
490
649
  errorMsg: string
@@ -503,168 +662,241 @@ declare namespace ty.p2p {
503
662
  /**
504
663
  * P2P status changed event
505
664
  * @public
506
- * @since P2PKit 7.7.5
665
+ * @since P2PKit 1.0.0
666
+ * @example Demo
667
+ * ```tsx
668
+ * ty.p2p.onSessionStatusChange(e => {
669
+ * console.log(e);
670
+ * });
671
+ * ```
507
672
  * @platform iOS Android
508
673
  */
509
674
  export function onSessionStatusChange(
510
- listener: (params: ThingP2PSessionStatus_IFof4A) => void
675
+ listener: (params: ThingP2PSessionStatus) => void
511
676
  ): void
512
677
 
513
678
  /**
514
679
  * P2P status changed event
515
680
  * @public
516
- * @since P2PKit 7.7.5
681
+ * @since P2PKit 1.0.0
682
+ * @example Demo
683
+ * ```tsx
684
+ * const listener = function (res) { console.log(res) }
685
+ * ty.p2p.onSessionStatusChange(listener)
686
+ * ty.p2p.offSessionStatusChange(listener)
687
+ * ```
517
688
  * @platform iOS Android
518
689
  */
519
690
  export function offSessionStatusChange(
520
- listener: (params: ThingP2PSessionStatus_IFof4A) => void
691
+ listener: (params: ThingP2PSessionStatus) => void
521
692
  ): void
522
693
 
523
694
  /**
524
695
  * upload file progress event
525
696
  * @public
526
697
  * @since P2PKit 0.0.1
698
+ * @example Demo
699
+ * ```tsx
700
+ * ty.p2p.onUploadProgressUpdate(e => {
701
+ * console.log(e);
702
+ * });
703
+ * ```
527
704
  * @platform iOS Android
528
705
  */
529
706
  export function onUploadProgressUpdate(
530
- listener: (params: ProgressEvent_pvSOoq) => void
707
+ listener: (params: ProgressEvent) => void
531
708
  ): void
532
709
 
533
710
  /**
534
711
  * upload file progress event
535
712
  * @public
536
713
  * @since P2PKit 0.0.1
714
+ * @example Demo
715
+ * ```tsx
716
+ * const listener = function (res) { console.log(res) }
717
+ * ty.p2p.onUploadProgressUpdate(listener)
718
+ * ty.p2p.offUploadProgressUpdate(listener)
719
+ * ```
537
720
  * @platform iOS Android
538
721
  */
539
722
  export function offUploadProgressUpdate(
540
- listener: (params: ProgressEvent_pvSOoq) => void
723
+ listener: (params: ProgressEvent) => void
541
724
  ): void
542
725
 
543
726
  /**
544
727
  * single file download progress event
545
728
  * @public
546
- * @since P2PKit 7.7.5
729
+ * @since P2PKit 1.0.0
730
+ * @example Demo
731
+ * ```tsx
732
+ * ty.p2p.onDownloadProgressUpdate(e => {
733
+ * console.log(e);
734
+ * });
735
+ * ```
547
736
  * @platform iOS Android
548
737
  */
549
738
  export function onDownloadProgressUpdate(
550
- listener: (params: DownloadProgressEvent_QH71Ba) => void
739
+ listener: (params: DownloadProgressEvent) => void
551
740
  ): void
552
741
 
553
742
  /**
554
743
  * single file download progress event
555
744
  * @public
556
- * @since P2PKit 7.7.5
745
+ * @since P2PKit 1.0.0
746
+ * @example Demo
747
+ * ```tsx
748
+ * const listener = function (res) { console.log(res) }
749
+ * ty.p2p.onDownloadProgressUpdate(listener)
750
+ * ty.p2p.offDownloadProgressUpdate(listener)
751
+ * ```
557
752
  * @platform iOS Android
558
753
  */
559
754
  export function offDownloadProgressUpdate(
560
- listener: (params: DownloadProgressEvent_QH71Ba) => void
755
+ listener: (params: DownloadProgressEvent) => void
561
756
  ): void
562
757
 
563
758
  /**
564
759
  * total download progress event
565
760
  * @public
566
- * @since P2PKit 7.7.5
761
+ * @since P2PKit 1.0.0
762
+ * @example Demo
763
+ * ```tsx
764
+ * ty.p2p.onDownloadTotalProgressUpdate(e => {
765
+ * console.log(e);
766
+ * });
767
+ * ```
567
768
  * @platform iOS Android
568
769
  */
569
770
  export function onDownloadTotalProgressUpdate(
570
- listener: (params: DownloadTotalProgressEvent_1Azddl) => void
771
+ listener: (params: DownloadTotalProgressEvent) => void
571
772
  ): void
572
773
 
573
774
  /**
574
775
  * total download progress event
575
776
  * @public
576
- * @since P2PKit 7.7.5
777
+ * @since P2PKit 1.0.0
778
+ * @example Demo
779
+ * ```tsx
780
+ * const listener = function (res) { console.log(res) }
781
+ * ty.p2p.onDownloadTotalProgressUpdate(listener)
782
+ * ty.p2p.offDownloadTotalProgressUpdate(listener)
783
+ * ```
577
784
  * @platform iOS Android
578
785
  */
579
786
  export function offDownloadTotalProgressUpdate(
580
- listener: (params: DownloadTotalProgressEvent_1Azddl) => void
787
+ listener: (params: DownloadTotalProgressEvent) => void
581
788
  ): void
582
789
 
583
790
  /**
584
791
  * single file download completed event
585
792
  * @public
586
- * @since P2PKit 7.7.5
793
+ * @since P2PKit 1.0.0
794
+ * @example Demo
795
+ * ```tsx
796
+ * ty.p2p.onFileDownloadComplete(e => {
797
+ * console.log(e);
798
+ * });
799
+ * ```
587
800
  * @platform iOS Android
588
801
  */
589
802
  export function onFileDownloadComplete(
590
- listener: (params: FileDownloadCompletionEvent_GsCY7d) => void
803
+ listener: (params: FileDownloadCompletionEvent) => void
591
804
  ): void
592
805
 
593
806
  /**
594
807
  * single file download completed event
595
808
  * @public
596
- * @since P2PKit 7.7.5
809
+ * @since P2PKit 1.0.0
810
+ * @example Demo
811
+ * ```tsx
812
+ * const listener = function (res) { console.log(res) }
813
+ * ty.p2p.onFileDownloadComplete(listener)
814
+ * ty.p2p.offFileDownloadComplete(listener)
815
+ * ```
597
816
  * @platform iOS Android
598
817
  */
599
818
  export function offFileDownloadComplete(
600
- listener: (params: FileDownloadCompletionEvent_GsCY7d) => void
819
+ listener: (params: FileDownloadCompletionEvent) => void
601
820
  ): void
602
821
 
603
822
  /**
604
823
  * download packet received event
605
824
  * @public
606
- * @since P2PKit 7.7.5
825
+ * @since P2PKit 2.0.2
826
+ * @example Demo
827
+ * ```tsx
828
+ * ty.p2p.onStreamPacketReceive(e => {
829
+ * console.log(e);
830
+ * });
831
+ * ```
607
832
  * @platform iOS Android
608
833
  */
609
834
  export function onStreamPacketReceive(
610
- listener: (params: StreamDownloadPacketReceivedEvent_aZmDrH) => void
835
+ listener: (params: StreamDownloadPacketReceivedEvent) => void
611
836
  ): void
612
837
 
613
838
  /**
614
839
  * download packet received event
615
840
  * @public
616
- * @since P2PKit 7.7.5
841
+ * @since P2PKit 2.0.2
842
+ * @example Demo
843
+ * ```tsx
844
+ * const listener = function (res) { console.log(res) }
845
+ * ty.p2p.onStreamPacketReceive(listener)
846
+ * ty.p2p.offStreamPacketReceive(listener)
847
+ * ```
617
848
  * @platform iOS Android
618
849
  */
619
850
  export function offStreamPacketReceive(
620
- listener: (params: StreamDownloadPacketReceivedEvent_aZmDrH) => void
851
+ listener: (params: StreamDownloadPacketReceivedEvent) => void
621
852
  ): void
622
853
 
623
- export interface ThingP2PInitConfigParams_OSkx6g {
854
+ /** @since P2PKit 2.0.0 */
855
+ export interface ThingP2PInitConfigParams {
624
856
  /**
625
857
  * user id
626
- * @since P2PKit 0.0.1
858
+ * @since P2PKit 2.0.0
627
859
  */
628
860
  userId?: string
629
861
  }
630
862
 
631
- export interface ThingP2PConnectionParams_RLnxyU {
863
+ /** @since P2PKit 2.0.0 */
864
+ export interface ThingP2PConnectionParams {
632
865
  /**
633
866
  * device id
634
- * @since P2PKit 0.0.1
635
867
  * @since P2PKit 2.0.3
636
868
  */
637
869
  deviceId: string
638
870
  /**
639
871
  * connect mode,0:INTERNET 1:LAN
640
- * @since P2PKit 0.0.1
641
872
  * @since P2PKit 2.0.3
642
873
  * @defaultValue 0
643
874
  */
644
875
  mode?: number
645
876
  /**
646
877
  * timeout,unit:ms, default as Internet:15000ms,Lan:3000ms
647
- * @since P2PKit 0.0.1
648
878
  * @since P2PKit 2.0.3
649
879
  * @defaultValue 0
650
880
  */
651
881
  timeout?: number
652
882
  }
653
883
 
654
- export interface ThingP2PAlbum_ARuQ0z {
884
+ /** @since P2PKit 2.0.0 */
885
+ export interface ThingP2PAlbum {
655
886
  /**
656
887
  * device id
657
- * @since P2PKit 1.0.0
888
+ * @since P2PKit 2.0.0
658
889
  */
659
890
  deviceId: string
660
891
  /**
661
892
  * albumName,given by the device
662
- * @since P2PKit 1.0.0
893
+ * @since P2PKit 2.0.0
663
894
  */
664
895
  albumName: string
665
896
  }
666
897
 
667
- export interface ThingP2PAlbumFileIndex_T9i2P3 {
898
+ /** @since P2PKit 2.0.0 */
899
+ export interface ThingP2PAlbumFileIndex {
668
900
  /**
669
901
  * idx,given by the device
670
902
  * @since P2PKit 2.0.2
@@ -702,175 +934,254 @@ declare namespace ty.p2p {
702
934
  duration: number
703
935
  }
704
936
 
705
- export interface ThingP2PAlbumFileIndexs_F2wjKg {
937
+ /** @since P2PKit 2.0.0 */
938
+ export interface ThingP2PAlbumFileIndexs {
706
939
  /**
707
940
  * file count
708
- * @since P2PKit 2.0.2
941
+ * @since P2PKit 2.0.0
709
942
  */
710
943
  count: number
711
944
  /**
712
945
  * file index infos
713
- * @since P2PKit 2.0.2
946
+ * @since P2PKit 2.0.0
714
947
  */
715
- items: ThingP2PAlbumFileIndex_T9i2P3[]
948
+ items: ThingP2PAlbumFileIndex[]
716
949
  }
717
950
 
718
- export interface ThingP2PUploadFile_IuQuKs {
951
+ /** @since P2PKit 2.0.0 */
952
+ export interface ThingP2PUploadFile {
719
953
  /**
720
954
  * device id
721
- * @since P2PKit 0.0.1
955
+ * @since P2PKit 2.0.0
722
956
  */
723
957
  deviceId: string
724
958
  /**
725
959
  * albumName given by the device
726
- * @since P2PKit 0.0.1
960
+ * @since P2PKit 2.0.0
727
961
  */
728
962
  albumName: string
729
963
  /**
730
964
  * local file path
731
- * @since P2PKit 0.0.1
965
+ * @since P2PKit 2.0.0
732
966
  */
733
967
  filePath: string
734
968
  /**
735
969
  * ext data
736
- * @since P2PKit 0.0.1
970
+ * @since P2PKit 2.0.0
737
971
  */
738
972
  extData?: string
739
973
  /**
740
974
  * ext data length
741
- * @since P2PKit 0.0.1
975
+ * @since P2PKit 2.0.0
742
976
  */
743
977
  extDataLength?: number
744
978
  }
745
979
 
746
- export interface ThingP2PDownloadFile_iUwmoX {
980
+ /** @since P2PKit 2.0.0 */
981
+ export interface ThingP2PDownloadFile {
747
982
  /**
748
983
  * device id
749
- * @since P2PKit 1.0.0
984
+ * @since P2PKit 2.0.0
750
985
  */
751
986
  deviceId: string
752
987
  /**
753
988
  * albumName given by the device
754
- * @since P2PKit 1.0.0
989
+ * @since P2PKit 2.0.0
755
990
  */
756
991
  albumName: string
757
992
  /**
758
993
  * local file path
759
- * @since P2PKit 1.0.0
994
+ * @since P2PKit 2.0.0
760
995
  */
761
996
  filePath: string
762
997
  /**
763
998
  * file name jsons,eg: {"files":["filesname1", "filesname2", "filesname3" ]}
764
- * @since P2PKit 1.0.0
999
+ * @since P2PKit 2.0.0
765
1000
  */
766
1001
  jsonfiles: string
767
1002
  }
768
1003
 
769
- export interface ThingP2PDownloadStream_kIvS10 {
1004
+ /** @since P2PKit 2.0.2 */
1005
+ export interface ThingP2PDownloadStream {
770
1006
  /**
771
1007
  * device id
772
1008
  * @since P2PKit 2.0.2
773
- * @since P2PKit 2.1.0
774
1009
  */
775
1010
  deviceId: string
776
1011
  /**
777
1012
  * albumName given by the device
778
1013
  * @since P2PKit 2.0.2
779
- * @since P2PKit 2.1.0
780
1014
  */
781
1015
  albumName: string
782
1016
  /**
783
1017
  * file name jsons,eg: {"files":["filesname1", "filesname2", "filesname3" ]}
784
1018
  * @since P2PKit 2.0.2
785
- * @since P2PKit 2.1.0
786
1019
  */
787
1020
  jsonfiles: string
788
1021
  }
789
1022
 
790
- export interface ThingP2PSessionStatus_IFof4A {
791
- /** device id */
1023
+ /** @since P2PKit 2.0.0 */
1024
+ export interface ThingP2PSessionStatus {
1025
+ /**
1026
+ * device id
1027
+ * @since P2PKit 2.0.0
1028
+ */
792
1029
  deviceId: string
793
- /** status, status < 0 means disconnected */
1030
+ /**
1031
+ * status, status < 0 means disconnected
1032
+ * @since P2PKit 2.0.0
1033
+ */
794
1034
  status: number
795
1035
  }
796
1036
 
797
- export interface ProgressEvent_pvSOoq {
798
- /** device id */
1037
+ /** @since P2PKit 0.0.1 */
1038
+ export interface ProgressEvent {
1039
+ /**
1040
+ * device id
1041
+ * @since P2PKit 0.0.1
1042
+ */
799
1043
  deviceId: string
800
- /** local file path */
1044
+ /**
1045
+ * local file path
1046
+ * @since P2PKit 0.0.1
1047
+ */
801
1048
  filePath: string
802
- /** upload/download progress */
1049
+ /**
1050
+ * upload/download progress
1051
+ * @since P2PKit 0.0.1
1052
+ */
803
1053
  progress: number
804
1054
  }
805
1055
 
806
- export interface DownloadProgressEvent_QH71Ba {
807
- /** device id */
1056
+ /** @since P2PKit 1.0.0 */
1057
+ export interface DownloadProgressEvent {
1058
+ /**
1059
+ * device id
1060
+ * @since P2PKit 1.0.0
1061
+ */
808
1062
  deviceId: string
809
- /** file name on downloading */
1063
+ /**
1064
+ * file name on downloading
1065
+ * @since P2PKit 1.0.0
1066
+ */
810
1067
  fileName: string
811
- /** upload/download progress */
1068
+ /**
1069
+ * upload/download progress
1070
+ * @since P2PKit 1.0.0
1071
+ */
812
1072
  progress: number
813
1073
  }
814
1074
 
815
- export interface DownloadTotalProgressEvent_1Azddl {
816
- /** device id */
1075
+ /** @since P2PKit 1.0.0 */
1076
+ export interface DownloadTotalProgressEvent {
1077
+ /**
1078
+ * device id
1079
+ * @since P2PKit 1.0.0
1080
+ */
817
1081
  deviceId: string
818
- /** upload/download progress */
1082
+ /**
1083
+ * upload/download progress
1084
+ * @since P2PKit 1.0.0
1085
+ */
819
1086
  progress: number
820
1087
  }
821
1088
 
822
- export interface FileDownloadCompletionEvent_GsCY7d {
823
- /** device id */
1089
+ /** @since P2PKit 1.0.0 */
1090
+ export interface FileDownloadCompletionEvent {
1091
+ /**
1092
+ * device id
1093
+ * @since P2PKit 1.0.0
1094
+ */
824
1095
  deviceId: string
825
- /** file name */
1096
+ /**
1097
+ * file name
1098
+ * @since P2PKit 1.0.0
1099
+ */
826
1100
  fileName: string
827
- /** index */
1101
+ /**
1102
+ * index
1103
+ * @since P2PKit 1.0.0
1104
+ */
828
1105
  index: number
829
1106
  }
830
1107
 
831
- export interface StreamDownloadPacketReceivedEvent_aZmDrH {
832
- /** device id */
1108
+ /** @since P2PKit 2.0.2 */
1109
+ export interface StreamDownloadPacketReceivedEvent {
1110
+ /**
1111
+ * device id
1112
+ * @since P2PKit 2.0.2
1113
+ */
833
1114
  deviceId: string
834
- /** total files count */
1115
+ /**
1116
+ * total files count
1117
+ * @since P2PKit 2.0.2
1118
+ */
835
1119
  totalFiles: number
836
- /** file name */
1120
+ /**
1121
+ * file name
1122
+ * @since P2PKit 2.0.2
1123
+ */
837
1124
  fileName: string
838
- /** file index, dirty data */
1125
+ /**
1126
+ * file index, dirty data
1127
+ * @since P2PKit 2.0.2
1128
+ */
839
1129
  fileIndex: number
840
- /** file length */
1130
+ /**
1131
+ * file length
1132
+ * @since P2PKit 2.0.2
1133
+ */
841
1134
  fileLength: number
842
- /** packet data */
1135
+ /**
1136
+ * packet data
1137
+ * @since P2PKit 2.0.2
1138
+ */
843
1139
  packetData: string
844
- /** packet data length */
1140
+ /**
1141
+ * packet data length
1142
+ * @since P2PKit 2.0.2
1143
+ */
845
1144
  packetLength: number
846
- /** file serial number */
1145
+ /**
1146
+ * file serial number
1147
+ * @since P2PKit 2.0.2
1148
+ */
847
1149
  fileSerialNumber: number
848
- /** packet index */
1150
+ /**
1151
+ * packet index
1152
+ * @since P2PKit 2.0.2
1153
+ */
849
1154
  packetIndex: number
850
- /** packet header/packet tail 0b00XY Y:packet header X:packet tail */
1155
+ /**
1156
+ * packet header/packet tail 0b00XY Y:packet header X:packet tail
1157
+ * @since P2PKit 2.0.2
1158
+ */
851
1159
  packetType: number
852
1160
  }
853
1161
 
854
- export interface ThingP2PUploadTask_33hECI {
1162
+ /** @since P2PKit 2.0.0 */
1163
+ export interface ThingP2PUploadTask {
855
1164
  /**
856
1165
  * device id
857
- * @since P2PKit 0.0.1
1166
+ * @since P2PKit 2.0.0
858
1167
  */
859
1168
  deviceId: string
860
1169
  }
861
1170
 
862
- export interface ThingP2PDownloadTask_UovyBk {
1171
+ /** @since P2PKit 2.0.0 */
1172
+ export interface ThingP2PDownloadTask {
863
1173
  /**
864
1174
  * device id
865
- * @since P2PKit 1.0.0
1175
+ * @since P2PKit 2.0.0
866
1176
  */
867
1177
  deviceId: string
868
1178
  }
869
1179
 
870
- export interface ThingP2PDevice_aYt5Df {
1180
+ /** @since P2PKit 2.0.0 */
1181
+ export interface ThingP2PDevice {
871
1182
  /**
872
1183
  * device id
873
- * @since P2PKit 0.0.1
1184
+ * @since P2PKit 2.0.0
874
1185
  */
875
1186
  deviceId: string
876
1187
  }