@ray-js/api 1.7.83-beta.0 → 1.7.84
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/AIStreamKit.d.ts +530 -10
- package/@types/BaseKit.d.ts +291 -233
- package/@types/BizKit.d.ts +499 -161
- package/@types/LightKit.d.ts +3 -3
- package/@types/MapKit.d.ts +24 -24
- package/@types/MiniKit.d.ts +117 -92
- package/@types/OutdoorKit.d.ts +61 -61
- package/@types/P2PKit.d.ts +25 -25
- package/@types/WearKit.d.ts +550 -26
- package/@types/api-extend.d.ts +1 -1
- package/lib/nativeRouters/device.d.ts +50 -15
- package/lib/nativeRouters/device.js +47 -15
- package/lib/nativeRouters/gw.d.ts +0 -3
- package/lib/nativeRouters/gw.js +0 -3
- package/lib/nativeRouters/outdoors.d.ts +12 -3
- package/lib/nativeRouters/outdoors.js +11 -3
- package/lib/nativeRouters/root.d.ts +33 -5
- package/lib/nativeRouters/root.js +32 -5
- package/package.json +5 -5
package/@types/AIStreamKit.d.ts
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AIStreamKit
|
|
3
3
|
*
|
|
4
|
-
* @version 2.2.
|
|
4
|
+
* @version 2.2.15
|
|
5
5
|
*/
|
|
6
6
|
declare namespace ty.aistream {
|
|
7
7
|
/**
|
|
8
8
|
* Get channel connection status
|
|
9
9
|
* @public
|
|
10
10
|
* @since AIStreamKit 1.0.0
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* ty.aistream.isConnected({
|
|
14
|
+
* clientType: 1,
|
|
15
|
+
* deviceId: "xx",
|
|
16
|
+
* success: data => {
|
|
17
|
+
* console.log(data);
|
|
18
|
+
* },
|
|
19
|
+
* fail: error => {
|
|
20
|
+
* console.error(error);
|
|
21
|
+
* },
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
11
24
|
* @platform iOS Android
|
|
12
25
|
*/
|
|
13
26
|
export function isConnected(params: {
|
|
@@ -66,6 +79,19 @@ declare namespace ty.aistream {
|
|
|
66
79
|
* Get channel connection status
|
|
67
80
|
* @public
|
|
68
81
|
* @since AIStreamKit 1.0.0
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* ty.aistream.isConnected({
|
|
85
|
+
* clientType: 1,
|
|
86
|
+
* deviceId: "xx",
|
|
87
|
+
* success: data => {
|
|
88
|
+
* console.log(data);
|
|
89
|
+
* },
|
|
90
|
+
* fail: error => {
|
|
91
|
+
* console.error(error);
|
|
92
|
+
* },
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
69
95
|
* @platform iOS Android
|
|
70
96
|
*/
|
|
71
97
|
export function isConnectedSync(params?: ConnectParams): {
|
|
@@ -95,6 +121,19 @@ declare namespace ty.aistream {
|
|
|
95
121
|
* Initiate channel connection, will callback success directly if already connected
|
|
96
122
|
* @public
|
|
97
123
|
* @since AIStreamKit 1.0.0
|
|
124
|
+
* @example
|
|
125
|
+
* ```tsx
|
|
126
|
+
* ty.aistream.connect({
|
|
127
|
+
* clientType: 1,
|
|
128
|
+
* deviceId: "xx",
|
|
129
|
+
* success: data => {
|
|
130
|
+
* console.log(data);
|
|
131
|
+
* },
|
|
132
|
+
* fail: error => {
|
|
133
|
+
* console.error(error);
|
|
134
|
+
* },
|
|
135
|
+
* });
|
|
136
|
+
* ```
|
|
98
137
|
* @platform iOS Android
|
|
99
138
|
*/
|
|
100
139
|
export function connect(params: {
|
|
@@ -138,6 +177,24 @@ declare namespace ty.aistream {
|
|
|
138
177
|
* Query agent token, pass to createSession
|
|
139
178
|
* @public
|
|
140
179
|
* @since AIStreamKit 1.0.0
|
|
180
|
+
* @example
|
|
181
|
+
* ```tsx
|
|
182
|
+
* ty.aistream.queryAgentToken({
|
|
183
|
+
* ownerId: "xx",
|
|
184
|
+
* solutionCode: "xx",
|
|
185
|
+
* api: "xx",
|
|
186
|
+
* apiVersion: "xx",
|
|
187
|
+
* extParams: {
|
|
188
|
+
* xx: "xx",
|
|
189
|
+
* },
|
|
190
|
+
* success: data => {
|
|
191
|
+
* console.log(data);
|
|
192
|
+
* },
|
|
193
|
+
* fail: error => {
|
|
194
|
+
* console.error(error);
|
|
195
|
+
* },
|
|
196
|
+
* });
|
|
197
|
+
* ```
|
|
141
198
|
* @platform iOS Android
|
|
142
199
|
*/
|
|
143
200
|
export function queryAgentToken(params: {
|
|
@@ -206,6 +263,34 @@ declare namespace ty.aistream {
|
|
|
206
263
|
* Create session
|
|
207
264
|
* @public
|
|
208
265
|
* @since AIStreamKit 1.0.0
|
|
266
|
+
* @example
|
|
267
|
+
* ```tsx
|
|
268
|
+
* ty.aistream.createSession({
|
|
269
|
+
* bizTag: 0,
|
|
270
|
+
* agentToken: "xx",
|
|
271
|
+
* sessionId: "xx",
|
|
272
|
+
* bizConfig: {
|
|
273
|
+
* bizCode: 65537,
|
|
274
|
+
* sendData: ["audio", "video", "text", "image", "file"],
|
|
275
|
+
* revData: ["text", "audio", "image", "video", "file"],
|
|
276
|
+
* },
|
|
277
|
+
* userData: [
|
|
278
|
+
* {
|
|
279
|
+
* type: 1,
|
|
280
|
+
* payloadType: 6,
|
|
281
|
+
* value: "xx",
|
|
282
|
+
* },
|
|
283
|
+
* ],
|
|
284
|
+
* userDataJson: "{}",
|
|
285
|
+
* reuseDataChannel: false,
|
|
286
|
+
* success: data => {
|
|
287
|
+
* console.log(data);
|
|
288
|
+
* },
|
|
289
|
+
* fail: error => {
|
|
290
|
+
* console.error(error);
|
|
291
|
+
* },
|
|
292
|
+
* });
|
|
293
|
+
* ```
|
|
209
294
|
* @platform iOS Android
|
|
210
295
|
*/
|
|
211
296
|
export function createSession(params: {
|
|
@@ -294,6 +379,19 @@ declare namespace ty.aistream {
|
|
|
294
379
|
* Close session
|
|
295
380
|
* @public
|
|
296
381
|
* @since AIStreamKit 1.0.0
|
|
382
|
+
* @example
|
|
383
|
+
* ```tsx
|
|
384
|
+
* ty.aistream.closeSession({
|
|
385
|
+
* sessionId: "xx",
|
|
386
|
+
* code: 200,
|
|
387
|
+
* success: data => {
|
|
388
|
+
* console.log(data);
|
|
389
|
+
* },
|
|
390
|
+
* fail: error => {
|
|
391
|
+
* console.error(error);
|
|
392
|
+
* },
|
|
393
|
+
* });
|
|
394
|
+
* ```
|
|
297
395
|
* @platform iOS Android
|
|
298
396
|
*/
|
|
299
397
|
export function closeSession(params: {
|
|
@@ -331,6 +429,18 @@ declare namespace ty.aistream {
|
|
|
331
429
|
* Close connection, mainly for device proxy scenario, not needed when used as App identity
|
|
332
430
|
* @public
|
|
333
431
|
* @since AIStreamKit 1.0.0
|
|
432
|
+
* @example
|
|
433
|
+
* ```tsx
|
|
434
|
+
* ty.aistream.disconnect({
|
|
435
|
+
* connectionId: "xx",
|
|
436
|
+
* success: data => {
|
|
437
|
+
* console.log(data);
|
|
438
|
+
* },
|
|
439
|
+
* fail: error => {
|
|
440
|
+
* console.error(error);
|
|
441
|
+
* },
|
|
442
|
+
* });
|
|
443
|
+
* ```
|
|
334
444
|
* @platform iOS Android
|
|
335
445
|
*/
|
|
336
446
|
export function disconnect(params: {
|
|
@@ -365,6 +475,27 @@ declare namespace ty.aistream {
|
|
|
365
475
|
* is invoked to begin the next event.
|
|
366
476
|
* @public
|
|
367
477
|
* @since AIStreamKit 1.0.0
|
|
478
|
+
* @example
|
|
479
|
+
* ```tsx
|
|
480
|
+
* ty.aistream.sendEventStart({
|
|
481
|
+
* sessionId: "xx",
|
|
482
|
+
* userData: [
|
|
483
|
+
* {
|
|
484
|
+
* type: 1,
|
|
485
|
+
* payloadType: 6,
|
|
486
|
+
* value: "xx",
|
|
487
|
+
* },
|
|
488
|
+
* ],
|
|
489
|
+
* userDataJson: "{}",
|
|
490
|
+
* eventIdPrefix: "xx",
|
|
491
|
+
* success: data => {
|
|
492
|
+
* console.log(data);
|
|
493
|
+
* },
|
|
494
|
+
* fail: error => {
|
|
495
|
+
* console.error(error);
|
|
496
|
+
* },
|
|
497
|
+
* });
|
|
498
|
+
* ```
|
|
368
499
|
* @platform iOS Android
|
|
369
500
|
*/
|
|
370
501
|
export function sendEventStart(params: {
|
|
@@ -420,6 +551,28 @@ declare namespace ty.aistream {
|
|
|
420
551
|
* Data stream transfer end event (deprecated in new version, internal implementation always callbacks success, use sendEventEnd directly after all data transfer is complete)
|
|
421
552
|
* @public
|
|
422
553
|
* @since AIStreamKit 1.0.0
|
|
554
|
+
* @example
|
|
555
|
+
* ```tsx
|
|
556
|
+
* ty.aistream.sendEventPayloadEnd({
|
|
557
|
+
* eventId: "xx",
|
|
558
|
+
* sessionId: "xx",
|
|
559
|
+
* dataChannel: "audio",
|
|
560
|
+
* userData: [
|
|
561
|
+
* {
|
|
562
|
+
* type: 1,
|
|
563
|
+
* payloadType: 6,
|
|
564
|
+
* value: "xx",
|
|
565
|
+
* },
|
|
566
|
+
* ],
|
|
567
|
+
* userDataJson: "{}",
|
|
568
|
+
* success: data => {
|
|
569
|
+
* console.log(data);
|
|
570
|
+
* },
|
|
571
|
+
* fail: error => {
|
|
572
|
+
* console.error(error);
|
|
573
|
+
* },
|
|
574
|
+
* });
|
|
575
|
+
* ```
|
|
423
576
|
* @platform iOS Android
|
|
424
577
|
*/
|
|
425
578
|
export function sendEventPayloadEnd(params: {
|
|
@@ -473,6 +626,27 @@ declare namespace ty.aistream {
|
|
|
473
626
|
* a new sendEventStart must be invoked to obtain a fresh eventId for the next event.
|
|
474
627
|
* @public
|
|
475
628
|
* @since AIStreamKit 1.0.0
|
|
629
|
+
* @example
|
|
630
|
+
* ```tsx
|
|
631
|
+
* ty.aistream.sendEventEnd({
|
|
632
|
+
* eventId: "xx",
|
|
633
|
+
* sessionId: "xx",
|
|
634
|
+
* userData: [
|
|
635
|
+
* {
|
|
636
|
+
* type: 1,
|
|
637
|
+
* payloadType: 6,
|
|
638
|
+
* value: "xx",
|
|
639
|
+
* },
|
|
640
|
+
* ],
|
|
641
|
+
* userDataJson: "{}",
|
|
642
|
+
* success: data => {
|
|
643
|
+
* console.log(data);
|
|
644
|
+
* },
|
|
645
|
+
* fail: error => {
|
|
646
|
+
* console.error(error);
|
|
647
|
+
* },
|
|
648
|
+
* });
|
|
649
|
+
* ```
|
|
476
650
|
* @platform iOS Android
|
|
477
651
|
*/
|
|
478
652
|
export function sendEventEnd(params: {
|
|
@@ -520,6 +694,27 @@ declare namespace ty.aistream {
|
|
|
520
694
|
* Interrupt event. Used for: 1. abort own sending, 2. abort receiving cloud reply
|
|
521
695
|
* @public
|
|
522
696
|
* @since AIStreamKit 1.0.0
|
|
697
|
+
* @example
|
|
698
|
+
* ```tsx
|
|
699
|
+
* ty.aistream.sendEventChatBreak({
|
|
700
|
+
* eventId: "xx",
|
|
701
|
+
* sessionId: "xx",
|
|
702
|
+
* userData: [
|
|
703
|
+
* {
|
|
704
|
+
* type: 1,
|
|
705
|
+
* payloadType: 6,
|
|
706
|
+
* value: "xx",
|
|
707
|
+
* },
|
|
708
|
+
* ],
|
|
709
|
+
* userDataJson: "{}",
|
|
710
|
+
* success: data => {
|
|
711
|
+
* console.log(data);
|
|
712
|
+
* },
|
|
713
|
+
* fail: error => {
|
|
714
|
+
* console.error(error);
|
|
715
|
+
* },
|
|
716
|
+
* });
|
|
717
|
+
* ```
|
|
523
718
|
* @platform iOS Android
|
|
524
719
|
*/
|
|
525
720
|
export function sendEventChatBreak(params: {
|
|
@@ -567,6 +762,29 @@ declare namespace ty.aistream {
|
|
|
567
762
|
* Send generic event (e.g. MCP response). Builds a StreamEvent with the given eventType and optional payload/userData, then sends it via the channel.
|
|
568
763
|
* @public
|
|
569
764
|
* @since AIStreamKit 2.2.0
|
|
765
|
+
* @example
|
|
766
|
+
* ```tsx
|
|
767
|
+
* ty.aistream.sendEvent({
|
|
768
|
+
* sessionId: "xx",
|
|
769
|
+
* eventId: "xx",
|
|
770
|
+
* eventType: 1000,
|
|
771
|
+
* payload: "xx",
|
|
772
|
+
* userData: [
|
|
773
|
+
* {
|
|
774
|
+
* type: 1,
|
|
775
|
+
* payloadType: 6,
|
|
776
|
+
* value: "xx",
|
|
777
|
+
* },
|
|
778
|
+
* ],
|
|
779
|
+
* userDataJson: "{}",
|
|
780
|
+
* success: data => {
|
|
781
|
+
* console.log(data);
|
|
782
|
+
* },
|
|
783
|
+
* fail: error => {
|
|
784
|
+
* console.error(error);
|
|
785
|
+
* },
|
|
786
|
+
* });
|
|
787
|
+
* ```
|
|
570
788
|
* @platform iOS Android
|
|
571
789
|
*/
|
|
572
790
|
export function sendEvent(params: {
|
|
@@ -636,6 +854,18 @@ declare namespace ty.aistream {
|
|
|
636
854
|
* Currently only SampleRate can be customized
|
|
637
855
|
* @public
|
|
638
856
|
* @since AIStreamKit 1.0.0
|
|
857
|
+
* @example
|
|
858
|
+
* ```tsx
|
|
859
|
+
* ty.aistream.initAudioRecorder({
|
|
860
|
+
* sampleRate: 16000,
|
|
861
|
+
* success: data => {
|
|
862
|
+
* console.log(data);
|
|
863
|
+
* },
|
|
864
|
+
* fail: error => {
|
|
865
|
+
* console.error(error);
|
|
866
|
+
* },
|
|
867
|
+
* });
|
|
868
|
+
* ```
|
|
639
869
|
* @platform iOS Android
|
|
640
870
|
*/
|
|
641
871
|
export function initAudioRecorder(params?: {
|
|
@@ -671,6 +901,31 @@ declare namespace ty.aistream {
|
|
|
671
901
|
* Note: initialization takes 300 ~ 600ms, speech cannot be captured during this time, it is recommended to call `initAudioRecorder` in advance
|
|
672
902
|
* @public
|
|
673
903
|
* @since AIStreamKit 1.0.0
|
|
904
|
+
* @example
|
|
905
|
+
* ```tsx
|
|
906
|
+
* ty.aistream.startRecordAndSendAudioData({
|
|
907
|
+
* sessionId: "xx",
|
|
908
|
+
* dataChannel: "audio",
|
|
909
|
+
* userData: [
|
|
910
|
+
* {
|
|
911
|
+
* type: 1,
|
|
912
|
+
* payloadType: 6,
|
|
913
|
+
* value: "xx",
|
|
914
|
+
* },
|
|
915
|
+
* ],
|
|
916
|
+
* saveFile: false,
|
|
917
|
+
* recordInitParams: {
|
|
918
|
+
* sampleRate: 16000,
|
|
919
|
+
* },
|
|
920
|
+
* userDataJson: "{}",
|
|
921
|
+
* success: data => {
|
|
922
|
+
* console.log(data);
|
|
923
|
+
* },
|
|
924
|
+
* fail: error => {
|
|
925
|
+
* console.error(error);
|
|
926
|
+
* },
|
|
927
|
+
* });
|
|
928
|
+
* ```
|
|
674
929
|
* @platform iOS Android
|
|
675
930
|
*/
|
|
676
931
|
export function startRecordAndSendAudioData(params: {
|
|
@@ -732,6 +987,31 @@ declare namespace ty.aistream {
|
|
|
732
987
|
* Stop recording and sending audio data
|
|
733
988
|
* @public
|
|
734
989
|
* @since AIStreamKit 1.0.0
|
|
990
|
+
* @example
|
|
991
|
+
* ```tsx
|
|
992
|
+
* ty.aistream.stopRecordAndSendAudioData({
|
|
993
|
+
* sessionId: "xx",
|
|
994
|
+
* dataChannel: "audio",
|
|
995
|
+
* userData: [
|
|
996
|
+
* {
|
|
997
|
+
* type: 1,
|
|
998
|
+
* payloadType: 6,
|
|
999
|
+
* value: "xx",
|
|
1000
|
+
* },
|
|
1001
|
+
* ],
|
|
1002
|
+
* saveFile: false,
|
|
1003
|
+
* recordInitParams: {
|
|
1004
|
+
* sampleRate: 16000,
|
|
1005
|
+
* },
|
|
1006
|
+
* userDataJson: "{}",
|
|
1007
|
+
* success: data => {
|
|
1008
|
+
* console.log(data);
|
|
1009
|
+
* },
|
|
1010
|
+
* fail: error => {
|
|
1011
|
+
* console.error(error);
|
|
1012
|
+
* },
|
|
1013
|
+
* });
|
|
1014
|
+
* ```
|
|
735
1015
|
* @platform iOS Android
|
|
736
1016
|
*/
|
|
737
1017
|
export function stopRecordAndSendAudioData(params: {
|
|
@@ -824,6 +1104,29 @@ declare namespace ty.aistream {
|
|
|
824
1104
|
* Send image data
|
|
825
1105
|
* @public
|
|
826
1106
|
* @since AIStreamKit 1.0.0
|
|
1107
|
+
* @example
|
|
1108
|
+
* ```tsx
|
|
1109
|
+
* ty.aistream.sendImageData({
|
|
1110
|
+
* sessionId: "xx",
|
|
1111
|
+
* dataChannel: "image",
|
|
1112
|
+
* path: "xx",
|
|
1113
|
+
* format: 1,
|
|
1114
|
+
* userData: [
|
|
1115
|
+
* {
|
|
1116
|
+
* type: 1,
|
|
1117
|
+
* payloadType: 6,
|
|
1118
|
+
* value: "xx",
|
|
1119
|
+
* },
|
|
1120
|
+
* ],
|
|
1121
|
+
* userDataJson: "{}",
|
|
1122
|
+
* success: data => {
|
|
1123
|
+
* console.log(data);
|
|
1124
|
+
* },
|
|
1125
|
+
* fail: error => {
|
|
1126
|
+
* console.error(error);
|
|
1127
|
+
* },
|
|
1128
|
+
* });
|
|
1129
|
+
* ```
|
|
827
1130
|
* @platform iOS Android
|
|
828
1131
|
*/
|
|
829
1132
|
export function sendImageData(params: {
|
|
@@ -881,6 +1184,28 @@ declare namespace ty.aistream {
|
|
|
881
1184
|
* Send text data
|
|
882
1185
|
* @public
|
|
883
1186
|
* @since AIStreamKit 1.0.0
|
|
1187
|
+
* @example
|
|
1188
|
+
* ```tsx
|
|
1189
|
+
* ty.aistream.sendTextData({
|
|
1190
|
+
* sessionId: "xx",
|
|
1191
|
+
* dataChannel: "text",
|
|
1192
|
+
* text: "xx",
|
|
1193
|
+
* userData: [
|
|
1194
|
+
* {
|
|
1195
|
+
* type: 1,
|
|
1196
|
+
* payloadType: 6,
|
|
1197
|
+
* value: "xx",
|
|
1198
|
+
* },
|
|
1199
|
+
* ],
|
|
1200
|
+
* userDataJson: "{}",
|
|
1201
|
+
* success: data => {
|
|
1202
|
+
* console.log(data);
|
|
1203
|
+
* },
|
|
1204
|
+
* fail: error => {
|
|
1205
|
+
* console.error(error);
|
|
1206
|
+
* },
|
|
1207
|
+
* });
|
|
1208
|
+
* ```
|
|
884
1209
|
* @platform iOS Android
|
|
885
1210
|
*/
|
|
886
1211
|
export function sendTextData(params: {
|
|
@@ -933,6 +1258,29 @@ declare namespace ty.aistream {
|
|
|
933
1258
|
* Batch query records
|
|
934
1259
|
* @public
|
|
935
1260
|
* @since AIStreamKit 1.0.0
|
|
1261
|
+
* @example
|
|
1262
|
+
* ```tsx
|
|
1263
|
+
* ty.aistream.queryRecordList({
|
|
1264
|
+
* id: [1],
|
|
1265
|
+
* bizCode: [65537],
|
|
1266
|
+
* solutionCode: ["xx"],
|
|
1267
|
+
* devId: ["xx"],
|
|
1268
|
+
* homeId: [1],
|
|
1269
|
+
* type: ["xx"],
|
|
1270
|
+
* index: ["xx"],
|
|
1271
|
+
* index1: ["xx"],
|
|
1272
|
+
* index2: ["xx"],
|
|
1273
|
+
* offset: 0,
|
|
1274
|
+
* limit: 20,
|
|
1275
|
+
* sortType: 0,
|
|
1276
|
+
* success: data => {
|
|
1277
|
+
* console.log(data);
|
|
1278
|
+
* },
|
|
1279
|
+
* fail: error => {
|
|
1280
|
+
* console.error(error);
|
|
1281
|
+
* },
|
|
1282
|
+
* });
|
|
1283
|
+
* ```
|
|
936
1284
|
* @platform iOS Android
|
|
937
1285
|
*/
|
|
938
1286
|
export function queryRecordList(params?: {
|
|
@@ -1033,6 +1381,26 @@ declare namespace ty.aistream {
|
|
|
1033
1381
|
* Batch delete records
|
|
1034
1382
|
* @public
|
|
1035
1383
|
* @since AIStreamKit 1.0.0
|
|
1384
|
+
* @example
|
|
1385
|
+
* ```tsx
|
|
1386
|
+
* ty.aistream.deleteRecordList({
|
|
1387
|
+
* id: [1],
|
|
1388
|
+
* bizCode: [65537],
|
|
1389
|
+
* solutionCode: ["xx"],
|
|
1390
|
+
* devId: ["xx"],
|
|
1391
|
+
* homeId: [1],
|
|
1392
|
+
* type: ["xx"],
|
|
1393
|
+
* index: ["xx"],
|
|
1394
|
+
* index1: ["xx"],
|
|
1395
|
+
* index2: ["xx"],
|
|
1396
|
+
* success: data => {
|
|
1397
|
+
* console.log(data);
|
|
1398
|
+
* },
|
|
1399
|
+
* fail: error => {
|
|
1400
|
+
* console.error(error);
|
|
1401
|
+
* },
|
|
1402
|
+
* });
|
|
1403
|
+
* ```
|
|
1036
1404
|
* @platform iOS Android
|
|
1037
1405
|
*/
|
|
1038
1406
|
export function deleteRecordList(params?: {
|
|
@@ -1122,6 +1490,30 @@ declare namespace ty.aistream {
|
|
|
1122
1490
|
* Update single record
|
|
1123
1491
|
* @public
|
|
1124
1492
|
* @since AIStreamKit 1.0.0
|
|
1493
|
+
* @example
|
|
1494
|
+
* ```tsx
|
|
1495
|
+
* ty.aistream.updateRecord({
|
|
1496
|
+
* id: 1,
|
|
1497
|
+
* bizCode: 65537,
|
|
1498
|
+
* solutionCode: "xx",
|
|
1499
|
+
* devId: "xx",
|
|
1500
|
+
* homeId: 1,
|
|
1501
|
+
* type: "xx",
|
|
1502
|
+
* index: "xx",
|
|
1503
|
+
* index1: "xx",
|
|
1504
|
+
* index2: "xx",
|
|
1505
|
+
* data: "{}",
|
|
1506
|
+
* value: "xx",
|
|
1507
|
+
* value1: "xx",
|
|
1508
|
+
* value2: "xx",
|
|
1509
|
+
* success: data => {
|
|
1510
|
+
* console.log(data);
|
|
1511
|
+
* },
|
|
1512
|
+
* fail: error => {
|
|
1513
|
+
* console.error(error);
|
|
1514
|
+
* },
|
|
1515
|
+
* });
|
|
1516
|
+
* ```
|
|
1125
1517
|
* @platform iOS Android
|
|
1126
1518
|
*/
|
|
1127
1519
|
export function updateRecord(params?: {
|
|
@@ -1214,6 +1606,29 @@ declare namespace ty.aistream {
|
|
|
1214
1606
|
* Insert single record
|
|
1215
1607
|
* @public
|
|
1216
1608
|
* @since AIStreamKit 1.0.0
|
|
1609
|
+
* @example
|
|
1610
|
+
* ```tsx
|
|
1611
|
+
* ty.aistream.insertRecord({
|
|
1612
|
+
* bizCode: 65537,
|
|
1613
|
+
* solutionCode: "xx",
|
|
1614
|
+
* devId: "xx",
|
|
1615
|
+
* homeId: 1,
|
|
1616
|
+
* type: "xx",
|
|
1617
|
+
* index: "xx",
|
|
1618
|
+
* index1: "xx",
|
|
1619
|
+
* index2: "xx",
|
|
1620
|
+
* data: "{}",
|
|
1621
|
+
* value: "xx",
|
|
1622
|
+
* value1: "xx",
|
|
1623
|
+
* value2: "xx",
|
|
1624
|
+
* success: data => {
|
|
1625
|
+
* console.log(data);
|
|
1626
|
+
* },
|
|
1627
|
+
* fail: error => {
|
|
1628
|
+
* console.error(error);
|
|
1629
|
+
* },
|
|
1630
|
+
* });
|
|
1631
|
+
* ```
|
|
1217
1632
|
* @platform iOS Android
|
|
1218
1633
|
*/
|
|
1219
1634
|
export function insertRecord(params?: {
|
|
@@ -1312,6 +1727,18 @@ declare namespace ty.aistream {
|
|
|
1312
1727
|
* Register audio amplitude listener (via `onRecordAmplitudes` callback)
|
|
1313
1728
|
* @public
|
|
1314
1729
|
* @since AIStreamKit 1.0.0
|
|
1730
|
+
* @example
|
|
1731
|
+
* ```tsx
|
|
1732
|
+
* ty.aistream.registerRecordAmplitudes({
|
|
1733
|
+
* count: 1,
|
|
1734
|
+
* success: data => {
|
|
1735
|
+
* console.log(data);
|
|
1736
|
+
* },
|
|
1737
|
+
* fail: error => {
|
|
1738
|
+
* console.error(error);
|
|
1739
|
+
* },
|
|
1740
|
+
* });
|
|
1741
|
+
* ```
|
|
1315
1742
|
* @platform iOS Android
|
|
1316
1743
|
*/
|
|
1317
1744
|
export function registerRecordAmplitudes(params: {
|
|
@@ -1344,6 +1771,17 @@ declare namespace ty.aistream {
|
|
|
1344
1771
|
* Unregister audio amplitude listener
|
|
1345
1772
|
* @public
|
|
1346
1773
|
* @since AIStreamKit 1.0.0
|
|
1774
|
+
* @example
|
|
1775
|
+
* ```tsx
|
|
1776
|
+
* ty.aistream.unregisterVoiceAmplitudes({
|
|
1777
|
+
* success: data => {
|
|
1778
|
+
* console.log(data);
|
|
1779
|
+
* },
|
|
1780
|
+
* fail: error => {
|
|
1781
|
+
* console.error(error);
|
|
1782
|
+
* },
|
|
1783
|
+
* });
|
|
1784
|
+
* ```
|
|
1347
1785
|
* @platform iOS Android
|
|
1348
1786
|
*/
|
|
1349
1787
|
export function unregisterVoiceAmplitudes(params?: {
|
|
@@ -1371,6 +1809,23 @@ declare namespace ty.aistream {
|
|
|
1371
1809
|
* Start playing received audio data
|
|
1372
1810
|
* @public
|
|
1373
1811
|
* @since AIStreamKit 1.0.0
|
|
1812
|
+
* @example
|
|
1813
|
+
* ```tsx
|
|
1814
|
+
* ty.aistream.startPlayAudio({
|
|
1815
|
+
* path: "xx",
|
|
1816
|
+
* codecType: 101,
|
|
1817
|
+
* sampleRate: 16000,
|
|
1818
|
+
* channels: 1,
|
|
1819
|
+
* bitDepth: 16,
|
|
1820
|
+
* pts: 1,
|
|
1821
|
+
* success: data => {
|
|
1822
|
+
* console.log(data);
|
|
1823
|
+
* },
|
|
1824
|
+
* fail: error => {
|
|
1825
|
+
* console.error(error);
|
|
1826
|
+
* },
|
|
1827
|
+
* });
|
|
1828
|
+
* ```
|
|
1374
1829
|
* @platform iOS Android
|
|
1375
1830
|
*/
|
|
1376
1831
|
export function startPlayAudio(params: {
|
|
@@ -1436,6 +1891,17 @@ declare namespace ty.aistream {
|
|
|
1436
1891
|
* Stop playing audio
|
|
1437
1892
|
* @public
|
|
1438
1893
|
* @since AIStreamKit 1.0.0
|
|
1894
|
+
* @example
|
|
1895
|
+
* ```tsx
|
|
1896
|
+
* ty.aistream.stopPlayAudio({
|
|
1897
|
+
* success: data => {
|
|
1898
|
+
* console.log(data);
|
|
1899
|
+
* },
|
|
1900
|
+
* fail: error => {
|
|
1901
|
+
* console.error(error);
|
|
1902
|
+
* },
|
|
1903
|
+
* });
|
|
1904
|
+
* ```
|
|
1439
1905
|
* @platform iOS Android
|
|
1440
1906
|
*/
|
|
1441
1907
|
export function stopPlayAudio(params?: {
|
|
@@ -1463,6 +1929,12 @@ declare namespace ty.aistream {
|
|
|
1463
1929
|
* Listen for Event receiving reports, note the eventType difference in body.
|
|
1464
1930
|
* @public
|
|
1465
1931
|
* @since AIStreamKit 1.0.0
|
|
1932
|
+
* @example
|
|
1933
|
+
* ```tsx
|
|
1934
|
+
* ty.aistream.onEventReceived(e => {
|
|
1935
|
+
* console.log(e);
|
|
1936
|
+
* });
|
|
1937
|
+
* ```
|
|
1466
1938
|
* @platform iOS Android
|
|
1467
1939
|
*/
|
|
1468
1940
|
export function onEventReceived(listener: (params: EventBody) => void): void
|
|
@@ -1471,7 +1943,7 @@ declare namespace ty.aistream {
|
|
|
1471
1943
|
* Listen for Event receiving reports, note the eventType difference in body.
|
|
1472
1944
|
* @public
|
|
1473
1945
|
* @since AIStreamKit 1.0.0
|
|
1474
|
-
* @example
|
|
1946
|
+
* @example
|
|
1475
1947
|
* ```tsx
|
|
1476
1948
|
* const listener = function (res) { console.log(res) }
|
|
1477
1949
|
* ty.aistream.onEventReceived(listener)
|
|
@@ -1487,6 +1959,12 @@ declare namespace ty.aistream {
|
|
|
1487
1959
|
* not triggered when streamFlag == 2 (transferring).
|
|
1488
1960
|
* @public
|
|
1489
1961
|
* @since AIStreamKit 1.0.0
|
|
1962
|
+
* @example
|
|
1963
|
+
* ```tsx
|
|
1964
|
+
* ty.aistream.onAudioReceived(e => {
|
|
1965
|
+
* console.log(e);
|
|
1966
|
+
* });
|
|
1967
|
+
* ```
|
|
1490
1968
|
* @platform iOS Android
|
|
1491
1969
|
*/
|
|
1492
1970
|
export function onAudioReceived(listener: (params: AudioBody) => void): void
|
|
@@ -1497,7 +1975,7 @@ declare namespace ty.aistream {
|
|
|
1497
1975
|
* not triggered when streamFlag == 2 (transferring).
|
|
1498
1976
|
* @public
|
|
1499
1977
|
* @since AIStreamKit 1.0.0
|
|
1500
|
-
* @example
|
|
1978
|
+
* @example
|
|
1501
1979
|
* ```tsx
|
|
1502
1980
|
* const listener = function (res) { console.log(res) }
|
|
1503
1981
|
* ty.aistream.onAudioReceived(listener)
|
|
@@ -1518,6 +1996,12 @@ declare namespace ty.aistream {
|
|
|
1518
1996
|
* is non-empty, regardless of streamFlag.
|
|
1519
1997
|
* @public
|
|
1520
1998
|
* @since AIStreamKit 1.0.0
|
|
1999
|
+
* @example
|
|
2000
|
+
* ```tsx
|
|
2001
|
+
* ty.aistream.onImageReceived(e => {
|
|
2002
|
+
* console.log(e);
|
|
2003
|
+
* });
|
|
2004
|
+
* ```
|
|
1521
2005
|
* @platform iOS Android
|
|
1522
2006
|
*/
|
|
1523
2007
|
export function onImageReceived(listener: (params: ImageBody) => void): void
|
|
@@ -1533,7 +2017,7 @@ declare namespace ty.aistream {
|
|
|
1533
2017
|
* is non-empty, regardless of streamFlag.
|
|
1534
2018
|
* @public
|
|
1535
2019
|
* @since AIStreamKit 1.0.0
|
|
1536
|
-
* @example
|
|
2020
|
+
* @example
|
|
1537
2021
|
* ```tsx
|
|
1538
2022
|
* const listener = function (res) { console.log(res) }
|
|
1539
2023
|
* ty.aistream.onImageReceived(listener)
|
|
@@ -1547,6 +2031,12 @@ declare namespace ty.aistream {
|
|
|
1547
2031
|
* Listen for text data receiving reports
|
|
1548
2032
|
* @public
|
|
1549
2033
|
* @since AIStreamKit 1.0.0
|
|
2034
|
+
* @example
|
|
2035
|
+
* ```tsx
|
|
2036
|
+
* ty.aistream.onTextReceived(e => {
|
|
2037
|
+
* console.log(e);
|
|
2038
|
+
* });
|
|
2039
|
+
* ```
|
|
1550
2040
|
* @platform iOS Android
|
|
1551
2041
|
*/
|
|
1552
2042
|
export function onTextReceived(listener: (params: TextBody) => void): void
|
|
@@ -1555,7 +2045,7 @@ declare namespace ty.aistream {
|
|
|
1555
2045
|
* Listen for text data receiving reports
|
|
1556
2046
|
* @public
|
|
1557
2047
|
* @since AIStreamKit 1.0.0
|
|
1558
|
-
* @example
|
|
2048
|
+
* @example
|
|
1559
2049
|
* ```tsx
|
|
1560
2050
|
* const listener = function (res) { console.log(res) }
|
|
1561
2051
|
* ty.aistream.onTextReceived(listener)
|
|
@@ -1569,6 +2059,12 @@ declare namespace ty.aistream {
|
|
|
1569
2059
|
* Listen for channel connection state changes
|
|
1570
2060
|
* @public
|
|
1571
2061
|
* @since AIStreamKit 1.0.0
|
|
2062
|
+
* @example
|
|
2063
|
+
* ```tsx
|
|
2064
|
+
* ty.aistream.onConnectStateChanged(e => {
|
|
2065
|
+
* console.log(e);
|
|
2066
|
+
* });
|
|
2067
|
+
* ```
|
|
1572
2068
|
* @platform iOS Android
|
|
1573
2069
|
*/
|
|
1574
2070
|
export function onConnectStateChanged(
|
|
@@ -1579,7 +2075,7 @@ declare namespace ty.aistream {
|
|
|
1579
2075
|
* Listen for channel connection state changes
|
|
1580
2076
|
* @public
|
|
1581
2077
|
* @since AIStreamKit 1.0.0
|
|
1582
|
-
* @example
|
|
2078
|
+
* @example
|
|
1583
2079
|
* ```tsx
|
|
1584
2080
|
* const listener = function (res) { console.log(res) }
|
|
1585
2081
|
* ty.aistream.onConnectStateChanged(listener)
|
|
@@ -1595,6 +2091,12 @@ declare namespace ty.aistream {
|
|
|
1595
2091
|
* Listen for session state changes
|
|
1596
2092
|
* @public
|
|
1597
2093
|
* @since AIStreamKit 1.0.0
|
|
2094
|
+
* @example
|
|
2095
|
+
* ```tsx
|
|
2096
|
+
* ty.aistream.onSessionStateChanged(e => {
|
|
2097
|
+
* console.log(e);
|
|
2098
|
+
* });
|
|
2099
|
+
* ```
|
|
1598
2100
|
* @platform iOS Android
|
|
1599
2101
|
*/
|
|
1600
2102
|
export function onSessionStateChanged(
|
|
@@ -1605,7 +2107,7 @@ declare namespace ty.aistream {
|
|
|
1605
2107
|
* Listen for session state changes
|
|
1606
2108
|
* @public
|
|
1607
2109
|
* @since AIStreamKit 1.0.0
|
|
1608
|
-
* @example
|
|
2110
|
+
* @example
|
|
1609
2111
|
* ```tsx
|
|
1610
2112
|
* const listener = function (res) { console.log(res) }
|
|
1611
2113
|
* ty.aistream.onSessionStateChanged(listener)
|
|
@@ -1621,6 +2123,12 @@ declare namespace ty.aistream {
|
|
|
1621
2123
|
* Audio amplitude callback (register listener via `registerRecordAmplitudes` first)
|
|
1622
2124
|
* @public
|
|
1623
2125
|
* @since AIStreamKit 1.0.0
|
|
2126
|
+
* @example
|
|
2127
|
+
* ```tsx
|
|
2128
|
+
* ty.aistream.onRecordAmplitudes(e => {
|
|
2129
|
+
* console.log(e);
|
|
2130
|
+
* });
|
|
2131
|
+
* ```
|
|
1624
2132
|
* @platform iOS Android
|
|
1625
2133
|
*/
|
|
1626
2134
|
export function onRecordAmplitudes(
|
|
@@ -1631,7 +2139,7 @@ declare namespace ty.aistream {
|
|
|
1631
2139
|
* Audio amplitude callback (register listener via `registerRecordAmplitudes` first)
|
|
1632
2140
|
* @public
|
|
1633
2141
|
* @since AIStreamKit 1.0.0
|
|
1634
|
-
* @example
|
|
2142
|
+
* @example
|
|
1635
2143
|
* ```tsx
|
|
1636
2144
|
* const listener = function (res) { console.log(res) }
|
|
1637
2145
|
* ty.aistream.onRecordAmplitudes(listener)
|
|
@@ -1647,6 +2155,12 @@ declare namespace ty.aistream {
|
|
|
1647
2155
|
* Audio playback state change
|
|
1648
2156
|
* @public
|
|
1649
2157
|
* @since AIStreamKit 1.0.0
|
|
2158
|
+
* @example
|
|
2159
|
+
* ```tsx
|
|
2160
|
+
* ty.aistream.onAudioPlayChanged(e => {
|
|
2161
|
+
* console.log(e);
|
|
2162
|
+
* });
|
|
2163
|
+
* ```
|
|
1650
2164
|
* @platform iOS Android
|
|
1651
2165
|
*/
|
|
1652
2166
|
export function onAudioPlayChanged(
|
|
@@ -1657,7 +2171,7 @@ declare namespace ty.aistream {
|
|
|
1657
2171
|
* Audio playback state change
|
|
1658
2172
|
* @public
|
|
1659
2173
|
* @since AIStreamKit 1.0.0
|
|
1660
|
-
* @example
|
|
2174
|
+
* @example
|
|
1661
2175
|
* ```tsx
|
|
1662
2176
|
* const listener = function (res) { console.log(res) }
|
|
1663
2177
|
* ty.aistream.onAudioPlayChanged(listener)
|
|
@@ -1673,6 +2187,12 @@ declare namespace ty.aistream {
|
|
|
1673
2187
|
* Audio recording and sending error
|
|
1674
2188
|
* @public
|
|
1675
2189
|
* @since AIStreamKit 1.0.0
|
|
2190
|
+
* @example
|
|
2191
|
+
* ```tsx
|
|
2192
|
+
* ty.aistream.onRecordAndSendAudioFail(e => {
|
|
2193
|
+
* console.log(e);
|
|
2194
|
+
* });
|
|
2195
|
+
* ```
|
|
1676
2196
|
* @platform iOS Android
|
|
1677
2197
|
*/
|
|
1678
2198
|
export function onRecordAndSendAudioFail(
|
|
@@ -1683,7 +2203,7 @@ declare namespace ty.aistream {
|
|
|
1683
2203
|
* Audio recording and sending error
|
|
1684
2204
|
* @public
|
|
1685
2205
|
* @since AIStreamKit 1.0.0
|
|
1686
|
-
* @example
|
|
2206
|
+
* @example
|
|
1687
2207
|
* ```tsx
|
|
1688
2208
|
* const listener = function (res) { console.log(res) }
|
|
1689
2209
|
* ty.aistream.onRecordAndSendAudioFail(listener)
|