@doubao-apps/create 0.0.25 → 0.0.26

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.
Files changed (33) hide show
  1. package/dist/template-empty/.ai/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +699 -0
  2. package/dist/template-empty/.ai/reference/open-api/02-storage.md +417 -0
  3. package/dist/template-empty/.ai/reference/open-api/03-router.md +165 -0
  4. package/dist/template-empty/.ai/reference/open-api/04-ui-/344/272/244/344/272/222.md +432 -0
  5. package/dist/template-empty/.ai/reference/open-api/05-ui-/350/276/223/345/205/245.md +95 -0
  6. package/dist/template-empty/.ai/reference/open-api/06-network.md +298 -0
  7. package/dist/template-empty/.ai/reference/open-api/07-media.md +346 -0
  8. package/dist/template-empty/.ai/reference/open-api/08-open-/344/270/232/345/212/241/350/203/275/345/212/233.md +477 -0
  9. package/dist/template-empty/.ai/reference/open-api/09-device-bluetooth.md +985 -0
  10. package/dist/template-empty/.ai/reference/open-api/10-device-wi-fi.md +277 -0
  11. package/dist/template-empty/.ai/reference/open-api/11-device-/344/274/240/346/204/237/345/231/250.md +372 -0
  12. package/dist/template-empty/.ai/reference/open-api/12-device-/346/234/254/345/234/260/350/203/275/345/212/233.md +1005 -0
  13. package/dist/template-empty/.ai/reference/open-api/README.md +20 -0
  14. package/dist/template-empty/.ai/reference/open-api.md +1532 -307
  15. package/dist/template-empty/AGENTS.md +2 -2
  16. package/dist/template-empty/package.json +2 -2
  17. package/dist/template-starter/.ai/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +699 -0
  18. package/dist/template-starter/.ai/reference/open-api/02-storage.md +417 -0
  19. package/dist/template-starter/.ai/reference/open-api/03-router.md +165 -0
  20. package/dist/template-starter/.ai/reference/open-api/04-ui-/344/272/244/344/272/222.md +432 -0
  21. package/dist/template-starter/.ai/reference/open-api/05-ui-/350/276/223/345/205/245.md +95 -0
  22. package/dist/template-starter/.ai/reference/open-api/06-network.md +298 -0
  23. package/dist/template-starter/.ai/reference/open-api/07-media.md +346 -0
  24. package/dist/template-starter/.ai/reference/open-api/08-open-/344/270/232/345/212/241/350/203/275/345/212/233.md +477 -0
  25. package/dist/template-starter/.ai/reference/open-api/09-device-bluetooth.md +985 -0
  26. package/dist/template-starter/.ai/reference/open-api/10-device-wi-fi.md +277 -0
  27. package/dist/template-starter/.ai/reference/open-api/11-device-/344/274/240/346/204/237/345/231/250.md +372 -0
  28. package/dist/template-starter/.ai/reference/open-api/12-device-/346/234/254/345/234/260/350/203/275/345/212/233.md +1005 -0
  29. package/dist/template-starter/.ai/reference/open-api/README.md +20 -0
  30. package/dist/template-starter/.ai/reference/open-api.md +1532 -307
  31. package/dist/template-starter/AGENTS.md +2 -2
  32. package/dist/template-starter/package.json +2 -2
  33. package/package.json +1 -1
@@ -72,12 +72,18 @@
72
72
 
73
73
  Promise 对象,授权成功时会返回授权结果
74
74
 
75
+ #### Remarks
76
+
77
+ 按 scope 申请授权。
78
+
75
79
  ***
76
80
 
77
81
  ### canIUse()
78
82
 
79
83
  > **canIUse**(`params`): `Promise`\<[`CanIUseResult`](doubao-apps-sdk-open-api.md#caniuseresult)\>
80
84
 
85
+ 检测当前宿主是否支持指定 API 或能力。
86
+
81
87
  #### Parameters
82
88
 
83
89
  • **params**: [`CanIUseParams`](doubao-apps-sdk-open-api.md#caniuseparams)
@@ -86,6 +92,10 @@ Promise 对象,授权成功时会返回授权结果
86
92
 
87
93
  `Promise`\<[`CanIUseResult`](doubao-apps-sdk-open-api.md#caniuseresult)\>
88
94
 
95
+ #### Remarks
96
+
97
+ 用于兼容性判断。
98
+
89
99
  ***
90
100
 
91
101
  ### checkIsOpenAccessibility()
@@ -96,7 +106,7 @@ Promise 对象,授权成功时会返回授权结果
96
106
 
97
107
  #### Parameters
98
108
 
99
- • **params?**: `Record`\<`string`, `never`\>
109
+ • **params?**
100
110
 
101
111
  #### Returns
102
112
 
@@ -112,7 +122,7 @@ Promise 对象,授权成功时会返回授权结果
112
122
 
113
123
  #### Parameters
114
124
 
115
- • **params?**: `Record`\<`string`, `never`\>
125
+ • **params?**
116
126
 
117
127
  #### Returns
118
128
 
@@ -120,6 +130,22 @@ Promise 对象,授权成功时会返回授权结果
120
130
 
121
131
  ***
122
132
 
133
+ ### chooseImage()
134
+
135
+ > **chooseImage**(`params`?): `Promise`\<[`ChooseImageResult`](doubao-apps-sdk-open-api.md#chooseimageresult)\>
136
+
137
+ 选择图片。
138
+
139
+ #### Parameters
140
+
141
+ • **params?**: [`ChooseImageParams`](doubao-apps-sdk-open-api.md#chooseimageparams)
142
+
143
+ #### Returns
144
+
145
+ `Promise`\<[`ChooseImageResult`](doubao-apps-sdk-open-api.md#chooseimageresult)\>
146
+
147
+ ***
148
+
123
149
  ### clearStorage()
124
150
 
125
151
  > **clearStorage**(`params`?): `Promise`\<`object`\>
@@ -234,12 +260,32 @@ closePage();
234
260
 
235
261
  #### Parameters
236
262
 
237
- • **params?**: `Record`\<`string`, `never`\>
263
+ • **params?**
238
264
 
239
265
  #### Returns
240
266
 
241
267
  `Promise`\<`object`\>
242
268
 
269
+ #### Remarks
270
+
271
+ 会关闭蓝牙模块。
272
+
273
+ ***
274
+
275
+ ### compressImage()
276
+
277
+ > **compressImage**(`params`): `Promise`\<[`CompressImageResult`](doubao-apps-sdk-open-api.md#compressimageresult)\>
278
+
279
+ 压缩图片。
280
+
281
+ #### Parameters
282
+
283
+ • **params**: [`CompressImageParams`](doubao-apps-sdk-open-api.md#compressimageparams)
284
+
285
+ #### Returns
286
+
287
+ `Promise`\<[`CompressImageResult`](doubao-apps-sdk-open-api.md#compressimageresult)\>
288
+
243
289
  ***
244
290
 
245
291
  ### connectWifi()
@@ -256,6 +302,10 @@ closePage();
256
302
 
257
303
  `Promise`\<`object`\>
258
304
 
305
+ #### Remarks
306
+
307
+ 通常先调用 startWifi。
308
+
259
309
  ***
260
310
 
261
311
  ### createBLEConnection()
@@ -272,18 +322,81 @@ closePage();
272
322
 
273
323
  `Promise`\<`object`\>
274
324
 
325
+ #### Remarks
326
+
327
+ 需要传入 deviceId。
328
+
329
+ ***
330
+
331
+ ### disableAlertBeforeUnload()
332
+
333
+ > **disableAlertBeforeUnload**(`params`?): `Promise`\<`object`\>
334
+
335
+ 关闭页面返回前提醒。
336
+
337
+ #### Parameters
338
+
339
+ • **params?**: `Record`\<`string`, `never`\>
340
+
341
+ #### Returns
342
+
343
+ `Promise`\<`object`\>
344
+
345
+ ***
346
+
347
+ ### dispatchActionDirective()
348
+
349
+ > **dispatchActionDirective**(`params`): `Promise`\<`object`\>
350
+
351
+ 描述用户行为,约束模型行为及指定执行路径
352
+
353
+ #### Parameters
354
+
355
+ • **params**: [`DispatchActionDirectiveParams`](doubao-apps-sdk-open-api.md#dispatchactiondirectiveparams)
356
+
357
+ #### Returns
358
+
359
+ `Promise`\<`object`\>
360
+
361
+ ***
362
+
363
+ ### enableAlertBeforeUnload()
364
+
365
+ > **enableAlertBeforeUnload**(`params`): `Promise`\<`object`\>
366
+
367
+ 开启页面返回前提醒。
368
+ 当用户在小程序非最底层页面点击左上角返回按钮、左上角首页按钮或 Android 系统 back 键时,弹起询问弹窗
369
+
370
+ 返回询问对话框只会对调用的当前页面生效,通过手势滑动返回时不会弹起询问对话框
371
+
372
+ #### Parameters
373
+
374
+ • **params**: [`EnableAlertBeforeUnloadParams`](doubao-apps-sdk-open-api.md#enablealertbeforeunloadparams)
375
+
376
+ #### Returns
377
+
378
+ `Promise`\<`object`\>
379
+
380
+ #### Remarks
381
+
382
+ 配合 disableAlertBeforeUnload 使用。
383
+
275
384
  ***
276
385
 
277
386
  ### exitApp()
278
387
 
279
388
  > **exitApp**(): `Promise`\<`object`\>
280
389
 
281
- 退去当前所有页面
390
+ 退出当前所有页面。
282
391
 
283
392
  #### Returns
284
393
 
285
394
  `Promise`\<`object`\>
286
395
 
396
+ #### Remarks
397
+
398
+ 会退出当前所有页面。
399
+
287
400
  ***
288
401
 
289
402
  ### getAccountInfo()
@@ -408,6 +521,10 @@ console.log(result.host?.appId, result.enableDebug);
408
521
 
409
522
  `Promise`\<[`GetBLEDeviceCharacteristicsResult`](doubao-apps-sdk-open-api.md#getbledevicecharacteristicsresult)\>
410
523
 
524
+ #### Remarks
525
+
526
+ 通常先获取 BLE 服务列表。
527
+
411
528
  ***
412
529
 
413
530
  ### getBLEDeviceRSSI()
@@ -440,6 +557,10 @@ console.log(result.host?.appId, result.enableDebug);
440
557
 
441
558
  `Promise`\<[`GetBLEDeviceServicesResult`](doubao-apps-sdk-open-api.md#getbledeviceservicesresult)\>
442
559
 
560
+ #### Remarks
561
+
562
+ 通常先调用 createBLEConnection。
563
+
443
564
  ***
444
565
 
445
566
  ### getBLEMTU()
@@ -466,7 +587,7 @@ console.log(result.host?.appId, result.enableDebug);
466
587
 
467
588
  #### Parameters
468
589
 
469
- • **params?**: `Record`\<`string`, `never`\>
590
+ • **params?**
470
591
 
471
592
  #### Returns
472
593
 
@@ -482,7 +603,7 @@ console.log(result.host?.appId, result.enableDebug);
482
603
 
483
604
  #### Parameters
484
605
 
485
- • **params?**: `Record`\<`string`, `never`\>
606
+ • **params?**
486
607
 
487
608
  #### Returns
488
609
 
@@ -498,7 +619,7 @@ console.log(result.host?.appId, result.enableDebug);
498
619
 
499
620
  #### Parameters
500
621
 
501
- • **params?**: `Record`\<`string`, `never`\>
622
+ • **params?**
502
623
 
503
624
  #### Returns
504
625
 
@@ -514,12 +635,16 @@ console.log(result.host?.appId, result.enableDebug);
514
635
 
515
636
  #### Parameters
516
637
 
517
- • **params?**: `Record`\<`string`, `never`\>
638
+ • **params?**
518
639
 
519
640
  #### Returns
520
641
 
521
642
  `Promise`\<[`GetBluetoothDevicesResult`](doubao-apps-sdk-open-api.md#getbluetoothdevicesresult)\>
522
643
 
644
+ #### Remarks
645
+
646
+ 通常先调用 startBluetoothDevicesDiscovery。
647
+
523
648
  ***
524
649
 
525
650
  ### getClipboardData()
@@ -530,7 +655,7 @@ console.log(result.host?.appId, result.enableDebug);
530
655
 
531
656
  #### Parameters
532
657
 
533
- • **params?**: `Record`\<`string`, `never`\>
658
+ • **params?**
534
659
 
535
660
  #### Returns
536
661
 
@@ -570,19 +695,19 @@ console.log(result.host?.appId, result.enableDebug);
570
695
 
571
696
  ***
572
697
 
573
- ### getHCEState()
698
+ ### getImageInfo()
574
699
 
575
- > **getHCEState**(`params`?): `Promise`\<`object`\>
700
+ > **getImageInfo**(`params`): `Promise`\<[`GetImageInfoResult`](doubao-apps-sdk-open-api.md#getimageinforesult)\>
576
701
 
577
- 获取 HCE 状态。
702
+ 获取图片信息。
578
703
 
579
704
  #### Parameters
580
705
 
581
- • **params?**: `Record`\<`string`, `never`\>
706
+ • **params**: [`GetImageInfoParams`](doubao-apps-sdk-open-api.md#getimageinfoparams)
582
707
 
583
708
  #### Returns
584
709
 
585
- `Promise`\<`object`\>
710
+ `Promise`\<[`GetImageInfoResult`](doubao-apps-sdk-open-api.md#getimageinforesult)\>
586
711
 
587
712
  ***
588
713
 
@@ -594,7 +719,7 @@ console.log(result.host?.appId, result.enableDebug);
594
719
 
595
720
  #### Parameters
596
721
 
597
- • **params?**: `Record`\<`string`, `never`\>
722
+ • **params?**
598
723
 
599
724
  #### Returns
600
725
 
@@ -628,6 +753,10 @@ console.log(result.host?.appId, result.enableDebug);
628
753
 
629
754
  如果调用失败(例如,用户拒绝权限、定位服务关闭等),则抛出此错误。
630
755
 
756
+ #### Remarks
757
+
758
+ 可能涉及定位授权。
759
+
631
760
  #### Example
632
761
 
633
762
  ```typescript
@@ -652,6 +781,35 @@ fetchLocation();
652
781
 
653
782
  ***
654
783
 
784
+ ### getMenuButtonBoundingClientRect()
785
+
786
+ > **getMenuButtonBoundingClientRect**(`params`?): [`MenuButtonBoundingClientRect`](doubao-apps-sdk-open-api.md#menubuttonboundingclientrect)
787
+
788
+ 获取菜单按钮的布局位置信息。
789
+
790
+ #### Parameters
791
+
792
+ • **params?**
793
+
794
+ #### Returns
795
+
796
+ [`MenuButtonBoundingClientRect`](doubao-apps-sdk-open-api.md#menubuttonboundingclientrect)
797
+
798
+ 返回菜单按钮相对屏幕左上角的坐标和尺寸,字段见 [MenuButtonBoundingClientRect](doubao-apps-sdk-open-api.md#menubuttonboundingclientrect)。
799
+
800
+ #### Example
801
+
802
+ ```ts
803
+ import { getMenuButtonBoundingClientRect } from '@doubao-apps/framework/api';
804
+
805
+ const rect = getMenuButtonBoundingClientRect();
806
+
807
+ console.log(rect.width, rect.height);
808
+ console.log(rect.top, rect.right, rect.bottom, rect.left);
809
+ ```
810
+
811
+ ***
812
+
655
813
  ### getNetworkType()
656
814
 
657
815
  > **getNetworkType**(`params`?): `Promise`\<[`GetNetworkTypeResult`](doubao-apps-sdk-open-api.md#getnetworktyperesult)\>
@@ -683,21 +841,27 @@ console.log(result.networkType);
683
841
 
684
842
  > **getOrderPayment**(`params`): `Promise`\<[`GetOrderPaymentResult`](doubao-apps-sdk-open-api.md#getorderpaymentresult)\>
685
843
 
844
+ 查询订单支付结果。
845
+
686
846
  #### Parameters
687
847
 
688
848
  • **params**: [`GetOrderPaymentParams`](doubao-apps-sdk-open-api.md#getorderpaymentparams)
689
849
 
850
+ 订单支付查询参数。
851
+
690
852
  #### Returns
691
853
 
692
854
  `Promise`\<[`GetOrderPaymentResult`](doubao-apps-sdk-open-api.md#getorderpaymentresult)\>
693
855
 
856
+ 返回订单支付结果。
857
+
694
858
  ***
695
859
 
696
860
  ### getPrivacySetting()
697
861
 
698
862
  > **getPrivacySetting**(`params`?): `Promise`\<[`PrivacySettingResult`](doubao-apps-sdk-open-api.md#privacysettingresult)\>
699
863
 
700
- Get privacy setting information
864
+ 获取隐私设置状态。
701
865
 
702
866
  #### Parameters
703
867
 
@@ -707,7 +871,7 @@ Get privacy setting information
707
871
 
708
872
  `Promise`\<[`PrivacySettingResult`](doubao-apps-sdk-open-api.md#privacysettingresult)\>
709
873
 
710
- Returns a Promise containing privacy setting information
874
+ 返回隐私设置状态。
711
875
 
712
876
  ***
713
877
 
@@ -751,7 +915,7 @@ Returns a Promise containing privacy setting information
751
915
 
752
916
  #### Parameters
753
917
 
754
- • **params?**: `Record`\<`string`, `never`\>
918
+ • **params?**
755
919
 
756
920
  #### Returns
757
921
 
@@ -781,6 +945,10 @@ Returns a Promise containing privacy setting information
781
945
 
782
946
  返回一个 Promise,解析为 [GetStorageResult](doubao-apps-sdk-open-api.md#getstorageresulttdata)。
783
947
 
948
+ #### Remarks
949
+
950
+ data 会 JSON 反序列化。
951
+
784
952
  #### Example
785
953
 
786
954
  ```typescript
@@ -873,6 +1041,10 @@ console.log(result.keys, result.currentSize, result.limitSize);
873
1041
 
874
1042
  返回 [GetStorageResult](doubao-apps-sdk-open-api.md#getstorageresulttdata)。
875
1043
 
1044
+ #### Remarks
1045
+
1046
+ data 会 JSON 反序列化。
1047
+
876
1048
  #### Example
877
1049
 
878
1050
  ```typescript
@@ -887,6 +1059,35 @@ console.log(result.data.name, result.data.age);
887
1059
 
888
1060
  ***
889
1061
 
1062
+ ### getSystemSetting()
1063
+
1064
+ > **getSystemSetting**(`params`?): [`GetSystemSettingResult`](doubao-apps-sdk-open-api.md#getsystemsettingresult)
1065
+
1066
+ 获取设备设置。
1067
+
1068
+ #### Parameters
1069
+
1070
+ • **params?**
1071
+
1072
+ #### Returns
1073
+
1074
+ [`GetSystemSettingResult`](doubao-apps-sdk-open-api.md#getsystemsettingresult)
1075
+
1076
+ 返回蓝牙、定位、Wi-Fi 系统开关和设备方向等字段,见 [GetSystemSettingResult](doubao-apps-sdk-open-api.md#getsystemsettingresult)。
1077
+
1078
+ #### Example
1079
+
1080
+ ```typescript
1081
+ import { getSystemSetting } from '@doubao-apps/framework/api';
1082
+
1083
+ const result = getSystemSetting();
1084
+
1085
+ console.log(result.bluetoothEnabled, result.locationEnabled);
1086
+ console.log(result.wifiEnabled, result.deviceOrientation);
1087
+ ```
1088
+
1089
+ ***
1090
+
890
1091
  ### getWifiList()
891
1092
 
892
1093
  > **getWifiList**(`params`?): `Promise`\<[`GetWifiListResult`](doubao-apps-sdk-open-api.md#getwifilistresult)\>
@@ -895,12 +1096,16 @@ console.log(result.data.name, result.data.age);
895
1096
 
896
1097
  #### Parameters
897
1098
 
898
- • **params?**: `Record`\<`string`, `never`\>
1099
+ • **params?**
899
1100
 
900
1101
  #### Returns
901
1102
 
902
1103
  `Promise`\<[`GetWifiListResult`](doubao-apps-sdk-open-api.md#getwifilistresult)\>
903
1104
 
1105
+ #### Remarks
1106
+
1107
+ 通常先调用 startWifi。
1108
+
904
1109
  ***
905
1110
 
906
1111
  ### getWindowInfo()
@@ -969,7 +1174,39 @@ console.log(result.safeArea?.top, result.screenTop);
969
1174
 
970
1175
  #### Parameters
971
1176
 
972
- • **params?**: `Record`\<`string`, `never`\>
1177
+ • **params?**
1178
+
1179
+ #### Returns
1180
+
1181
+ `Promise`\<`object`\>
1182
+
1183
+ ***
1184
+
1185
+ ### hideLoading()
1186
+
1187
+ > **hideLoading**(`params`?): `Promise`\<`object`\>
1188
+
1189
+ 隐藏当前 loading。
1190
+
1191
+ #### Parameters
1192
+
1193
+ • **params?**: [`HideInteractionParams`](doubao-apps-sdk-open-api.md#hideinteractionparams)
1194
+
1195
+ #### Returns
1196
+
1197
+ `Promise`\<`object`\>
1198
+
1199
+ ***
1200
+
1201
+ ### hideToast()
1202
+
1203
+ > **hideToast**(`params`?): `Promise`\<`object`\>
1204
+
1205
+ 隐藏当前 Toast。
1206
+
1207
+ #### Parameters
1208
+
1209
+ • **params?**: [`HideInteractionParams`](doubao-apps-sdk-open-api.md#hideinteractionparams)
973
1210
 
974
1211
  #### Returns
975
1212
 
@@ -997,19 +1234,19 @@ console.log(result.safeArea?.top, result.screenTop);
997
1234
 
998
1235
  > **login**(`params`?): `Promise`\<[`LoginResult`](doubao-apps-sdk-open-api.md#loginresult)\>
999
1236
 
1000
- Initiate login
1237
+ 发起登录并获取登录凭证。
1001
1238
 
1002
1239
  #### Parameters
1003
1240
 
1004
1241
  • **params?**: [`LoginRequest`](doubao-apps-sdk-open-api.md#loginrequest)
1005
1242
 
1006
- Login parameters
1243
+ 登录参数。
1007
1244
 
1008
1245
  #### Returns
1009
1246
 
1010
1247
  `Promise`\<[`LoginResult`](doubao-apps-sdk-open-api.md#loginresult)\>
1011
1248
 
1012
- Returns a Promise containing the login credential code
1249
+ 返回包含登录凭证 code Promise
1013
1250
 
1014
1251
  ***
1015
1252
 
@@ -1017,19 +1254,19 @@ Returns a Promise containing the login credential code
1017
1254
 
1018
1255
  > **loginWithDoubaoWidget**(`params`): `Promise`\<[`LoginWithWidgetResult`](doubao-apps-sdk-open-api.md#loginwithwidgetresult)\>
1019
1256
 
1020
- Initiate login
1257
+ 发起豆包 Widget 登录。
1021
1258
 
1022
1259
  #### Parameters
1023
1260
 
1024
1261
  • **params**: [`LoginWithWidgetRequest`](doubao-apps-sdk-open-api.md#loginwithwidgetrequest)
1025
1262
 
1026
- Login parameters
1263
+ Widget 登录参数。
1027
1264
 
1028
1265
  #### Returns
1029
1266
 
1030
1267
  `Promise`\<[`LoginWithWidgetResult`](doubao-apps-sdk-open-api.md#loginwithwidgetresult)\>
1031
1268
 
1032
- Returns a Promise containing the login credential code
1269
+ 返回登录结果。
1033
1270
 
1034
1271
  ***
1035
1272
 
@@ -1111,13 +1348,17 @@ Returns a Promise containing the login credential code
1111
1348
 
1112
1349
  `Promise`\<`object`\>
1113
1350
 
1351
+ #### Remarks
1352
+
1353
+ 订阅指定特征值变化。
1354
+
1114
1355
  ***
1115
1356
 
1116
- ### onKeyboardHeightChange()
1357
+ ### onCompassChange()
1117
1358
 
1118
- > **onKeyboardHeightChange**(`handler`): () => `void`
1359
+ > **onCompassChange**(`handler`): () => `void`
1119
1360
 
1120
- 监听键盘高度变化事件。
1361
+ 监听罗盘数据变化事件。
1121
1362
 
1122
1363
  #### Parameters
1123
1364
 
@@ -1127,112 +1368,237 @@ Returns a Promise containing the login credential code
1127
1368
 
1128
1369
  `Function`
1129
1370
 
1371
+ 返回取消当前监听函数的函数。
1372
+
1130
1373
  ##### Returns
1131
1374
 
1132
1375
  `void`
1133
1376
 
1134
1377
  #### Example
1135
1378
 
1136
- ```typescript
1137
- import { onKeyboardHeightChange } from '@doubao-apps/framework/api';
1379
+ ```ts
1380
+ import { onCompassChange } from '@doubao-apps/framework/api';
1138
1381
 
1139
- const unsubscribe = onKeyboardHeightChange(({ height }) => {
1140
- console.log('Keyboard height change event:', { height });
1382
+ const off = onCompassChange(({ direction }) => {
1383
+ console.log(direction);
1141
1384
  });
1385
+
1386
+ off();
1142
1387
  ```
1143
1388
 
1144
1389
  ***
1145
1390
 
1146
- ### openApp()
1147
-
1148
- > **openApp**(`params`): `Promise`\<[`OpenAppResult`](doubao-apps-sdk-open-api.md#openappresult)\>
1149
-
1150
- Open an external application using a deep link with fallbacks.
1391
+ ### onKeyboardHeightChange()
1151
1392
 
1152
- Params (see OpenAppRequest):
1153
- - uri: required deep link URI to open.
1154
- - targetPackage?: preferred Android package name.
1155
- - fallbackUrl?: URL to open via market or browser when deep link fails.
1393
+ > **onKeyboardHeightChange**(`handler`): () => `void`
1156
1394
 
1157
- Returns a Promise that resolves with an execution status and optional message.
1395
+ 监听键盘高度变化事件。
1158
1396
 
1159
1397
  #### Parameters
1160
1398
 
1161
- • **params**: [`OpenAppRequest`](doubao-apps-sdk-open-api.md#openapprequest)
1399
+ • **handler**
1162
1400
 
1163
1401
  #### Returns
1164
1402
 
1165
- `Promise`\<[`OpenAppResult`](doubao-apps-sdk-open-api.md#openappresult)\>
1166
-
1167
- ***
1168
-
1169
- ### openBluetoothAdapter()
1170
-
1171
- > **openBluetoothAdapter**(`params`?): `Promise`\<`object`\>
1403
+ `Function`
1172
1404
 
1173
- 打开蓝牙适配器。
1405
+ ##### Returns
1174
1406
 
1175
- #### Parameters
1407
+ `void`
1176
1408
 
1177
- **params?**: [`OpenBluetoothAdapterParams`](doubao-apps-sdk-open-api.md#openbluetoothadapterparams)
1409
+ #### Example
1178
1410
 
1179
- #### Returns
1411
+ ```typescript
1412
+ import { onKeyboardHeightChange } from '@doubao-apps/framework/api';
1180
1413
 
1181
- `Promise`\<`object`\>
1414
+ const unsubscribe = onKeyboardHeightChange(({ height }) => {
1415
+ console.log('Keyboard height change event:', { height });
1416
+ });
1417
+ ```
1182
1418
 
1183
1419
  ***
1184
1420
 
1185
- ### postLoginResult()
1421
+ ### onNetworkStatusChange()
1186
1422
 
1187
- > **postLoginResult**(`params`): `Promise`\<`object`\>
1423
+ > **onNetworkStatusChange**(`handler`): () => `void`
1188
1424
 
1189
- Report MCP authorization login credential
1425
+ 监听网络状态变化事件。
1190
1426
 
1191
1427
  #### Parameters
1192
1428
 
1193
- • **params**: [`PostLoginResultRequest`](doubao-apps-sdk-open-api.md#postloginresultrequest)
1194
-
1195
- Post login result parameters
1429
+ • **handler**
1196
1430
 
1197
1431
  #### Returns
1198
1432
 
1199
- `Promise`\<`object`\>
1200
-
1201
- Returns a Promise that resolves when the report is successful
1433
+ `Function`
1202
1434
 
1203
- ***
1435
+ 返回取消当前监听函数的函数。
1204
1436
 
1205
- ### reLaunch()
1437
+ ##### Returns
1206
1438
 
1207
- > **reLaunch**(`params`): `Promise`\<`object`\>
1439
+ `void`
1208
1440
 
1209
- #### Parameters
1441
+ #### Example
1210
1442
 
1211
- • **params**: [`NavigateToParams`](doubao-apps-sdk-open-api.md#navigatetoparams)
1443
+ ```ts
1444
+ import { onNetworkStatusChange } from '@doubao-apps/framework/api';
1212
1445
 
1213
- #### Returns
1446
+ const off = onNetworkStatusChange(({ isConnected, networkType }) => {
1447
+ console.log(isConnected, networkType);
1448
+ });
1214
1449
 
1215
- `Promise`\<`object`\>
1450
+ off();
1451
+ ```
1216
1452
 
1217
1453
  ***
1218
1454
 
1219
- ### readBLECharacteristicValue()
1455
+ ### onUserCaptureScreen()
1220
1456
 
1221
- > **readBLECharacteristicValue**(`params`): `Promise`\<`object`\>
1457
+ > **onUserCaptureScreen**(`handler`): () => `void`
1222
1458
 
1223
- 读取 BLE 特征值。
1459
+ 监听用户主动截屏事件。
1224
1460
 
1225
1461
  #### Parameters
1226
1462
 
1227
- • **params**: [`ReadBLECharacteristicValueParams`](doubao-apps-sdk-open-api.md#readblecharacteristicvalueparams)
1463
+ • **handler**
1228
1464
 
1229
1465
  #### Returns
1230
1466
 
1231
- `Promise`\<`object`\>
1467
+ `Function`
1232
1468
 
1233
- ***
1469
+ 返回取消当前监听函数的函数。
1234
1470
 
1235
- ### redirectTo()
1471
+ ##### Returns
1472
+
1473
+ `void`
1474
+
1475
+ #### Example
1476
+
1477
+ ```ts
1478
+ import { onUserCaptureScreen } from '@doubao-apps/framework/api';
1479
+
1480
+ const off = onUserCaptureScreen(() => {
1481
+ console.log('用户截屏了');
1482
+ });
1483
+
1484
+ off();
1485
+ ```
1486
+
1487
+ ***
1488
+
1489
+ ### openApp()
1490
+
1491
+ > **openApp**(`params`): `Promise`\<[`OpenAppResult`](doubao-apps-sdk-open-api.md#openappresult)\>
1492
+
1493
+ 通过 deep link 等方式打开外部应用。
1494
+
1495
+ #### Parameters
1496
+
1497
+ • **params**: [`OpenAppRequest`](doubao-apps-sdk-open-api.md#openapprequest)
1498
+
1499
+ 外部应用打开参数。
1500
+
1501
+ #### Returns
1502
+
1503
+ `Promise`\<[`OpenAppResult`](doubao-apps-sdk-open-api.md#openappresult)\>
1504
+
1505
+ 返回外部应用打开结果。
1506
+
1507
+ ***
1508
+
1509
+ ### openBluetoothAdapter()
1510
+
1511
+ > **openBluetoothAdapter**(`params`?): `Promise`\<`object`\>
1512
+
1513
+ 打开蓝牙适配器。
1514
+
1515
+ #### Parameters
1516
+
1517
+ • **params?**: [`OpenBluetoothAdapterParams`](doubao-apps-sdk-open-api.md#openbluetoothadapterparams)
1518
+
1519
+ #### Returns
1520
+
1521
+ `Promise`\<`object`\>
1522
+
1523
+ #### Remarks
1524
+
1525
+ 蓝牙流程入口。
1526
+
1527
+ ***
1528
+
1529
+ ### postLoginResult()
1530
+
1531
+ > **postLoginResult**(`params`): `Promise`\<`object`\>
1532
+
1533
+ 回传 MCP 授权登录凭证。
1534
+
1535
+ #### Parameters
1536
+
1537
+ • **params**: [`PostLoginResultRequest`](doubao-apps-sdk-open-api.md#postloginresultrequest)
1538
+
1539
+ 登录结果回传参数。
1540
+
1541
+ #### Returns
1542
+
1543
+ `Promise`\<`object`\>
1544
+
1545
+ 返回回传完成的 Promise。
1546
+
1547
+ ***
1548
+
1549
+ ### previewImage()
1550
+
1551
+ > **previewImage**(`params`): `Promise`\<`object`\>
1552
+
1553
+ 预览图片。
1554
+
1555
+ #### Parameters
1556
+
1557
+ • **params**: [`PreviewImageParams`](doubao-apps-sdk-open-api.md#previewimageparams)
1558
+
1559
+ #### Returns
1560
+
1561
+ `Promise`\<`object`\>
1562
+
1563
+ ***
1564
+
1565
+ ### reLaunch()
1566
+
1567
+ > **reLaunch**(`params`): `Promise`\<`object`\>
1568
+
1569
+ 关闭所有页面并跳转到应用内页面。
1570
+
1571
+ #### Parameters
1572
+
1573
+ • **params**: [`NavigateToParams`](doubao-apps-sdk-open-api.md#navigatetoparams)
1574
+
1575
+ #### Returns
1576
+
1577
+ `Promise`\<`object`\>
1578
+
1579
+ ***
1580
+
1581
+ ### readBLECharacteristicValue()
1582
+
1583
+ > **readBLECharacteristicValue**(`params`): `Promise`\<`object`\>
1584
+
1585
+ 读取 BLE 特征值。
1586
+
1587
+ #### Parameters
1588
+
1589
+ • **params**: [`ReadBLECharacteristicValueParams`](doubao-apps-sdk-open-api.md#readblecharacteristicvalueparams)
1590
+
1591
+ #### Returns
1592
+
1593
+ `Promise`\<`object`\>
1594
+
1595
+ #### Remarks
1596
+
1597
+ 需要传入 serviceId 和 characteristicId。
1598
+
1599
+ ***
1600
+
1601
+ ### redirectTo()
1236
1602
 
1237
1603
  > **redirectTo**(`params`): `Promise`\<`object`\>
1238
1604
 
@@ -1322,6 +1688,10 @@ removeStorageSync({ key: 'profile' });
1322
1688
 
1323
1689
  返回一个 Promise,解析为 [RequestResponse](doubao-apps-sdk-open-api.md#requestresponse)。
1324
1690
 
1691
+ #### Remarks
1692
+
1693
+ 返回 statusCode、header 和 data。
1694
+
1325
1695
  #### Example
1326
1696
 
1327
1697
  ```typescript
@@ -1344,45 +1714,63 @@ console.log(result.statusCode, result.data);
1344
1714
 
1345
1715
  > **requestOrder**(`params`): `Promise`\<[`RequestOrderResult`](doubao-apps-sdk-open-api.md#requestorderresult)\>
1346
1716
 
1717
+ 发起订单支付流程。
1718
+
1347
1719
  #### Parameters
1348
1720
 
1349
1721
  • **params**: [`RequestOrderParams`](doubao-apps-sdk-open-api.md#requestorderparams)
1350
1722
 
1723
+ 订单支付请求参数。
1724
+
1351
1725
  #### Returns
1352
1726
 
1353
1727
  `Promise`\<[`RequestOrderResult`](doubao-apps-sdk-open-api.md#requestorderresult)\>
1354
1728
 
1729
+ 返回订单支付请求结果。
1730
+
1355
1731
  ***
1356
1732
 
1357
- ### scanCode()
1733
+ ### saveImageToPhotosAlbum()
1358
1734
 
1359
- > **scanCode**(`params`?): `Promise`\<[`ScanCodeResult`](doubao-apps-sdk-open-api.md#scancoderesult)\>
1735
+ > **saveImageToPhotosAlbum**(`params`): `Promise`\<`object`\>
1360
1736
 
1361
- 调起扫码能力。
1737
+ 保存图片到系统相册。
1738
+
1739
+ 需要先确保应用已具备写入系统相册的权限。
1362
1740
 
1363
1741
  #### Parameters
1364
1742
 
1365
- • **params?**: [`ScanCodeParams`](doubao-apps-sdk-open-api.md#scancodeparams)
1743
+ • **params**: [`SaveImageToPhotosAlbumParams`](doubao-apps-sdk-open-api.md#saveimagetophotosalbumparams)
1366
1744
 
1367
1745
  #### Returns
1368
1746
 
1369
- `Promise`\<[`ScanCodeResult`](doubao-apps-sdk-open-api.md#scancoderesult)\>
1747
+ `Promise`\<`object`\>
1748
+
1749
+ #### Example
1750
+
1751
+ ```typescript
1752
+ import { saveImageToPhotosAlbum } from '@doubao-apps/framework/api';
1753
+
1754
+ await saveImageToPhotosAlbum({
1755
+ filePath: '/path/to/image.png'
1756
+ });
1757
+ ```
1370
1758
 
1371
1759
  ***
1372
1760
 
1373
- ### sendHCEMessage()
1761
+ ### scanCode()
1374
1762
 
1375
- > **sendHCEMessage**(`params`): `Promise`\<`object`\>
1763
+ > **scanCode**(`params`?): `Promise`\<[`ScanCodeResult`](doubao-apps-sdk-open-api.md#scancoderesult)\>
1376
1764
 
1377
- 发送 HCE 消息。
1765
+ 调起扫码能力。
1378
1766
 
1379
1767
  #### Parameters
1380
1768
 
1381
- • **params**: [`SendHCEMessageParams`](doubao-apps-sdk-open-api.md#sendhcemessageparams)
1769
+ • **params?**: [`ScanCodeParams`](doubao-apps-sdk-open-api.md#scancodeparams)
1382
1770
 
1383
1771
  #### Returns
1384
1772
 
1385
- `Promise`\<`object`\>
1773
+ `Promise`\<[`ScanCodeResult`](doubao-apps-sdk-open-api.md#scancoderesult)\>
1386
1774
 
1387
1775
  ***
1388
1776
 
@@ -1447,20 +1835,16 @@ await sendSms({
1447
1835
 
1448
1836
  #### Parameters
1449
1837
 
1450
- • **params**
1451
-
1452
- • **params.additionalContext**: `string`
1453
-
1454
- 上下文内容
1455
-
1456
- • **params.botId?**: `string`
1457
-
1458
- 指定 bot id
1838
+ • **params**: [`SetAdditionalContextParams`](doubao-apps-sdk-open-api.md#setadditionalcontextparams)
1459
1839
 
1460
1840
  #### Returns
1461
1841
 
1462
1842
  `Promise`\<`object`\>
1463
1843
 
1844
+ #### Remarks
1845
+
1846
+ 设置全局上下文。
1847
+
1464
1848
  ***
1465
1849
 
1466
1850
  ### setBLEMTU()
@@ -1549,6 +1933,10 @@ await sendSms({
1549
1933
 
1550
1934
  返回一个 Promise,写入完成后 resolve。
1551
1935
 
1936
+ #### Remarks
1937
+
1938
+ data 会 JSON 序列化。
1939
+
1552
1940
  #### Example
1553
1941
 
1554
1942
  ```typescript
@@ -1584,6 +1972,10 @@ await setStorage({
1584
1972
 
1585
1973
  同步写入完成后返回。
1586
1974
 
1975
+ #### Remarks
1976
+
1977
+ data 会 JSON 序列化。
1978
+
1587
1979
  #### Example
1588
1980
 
1589
1981
  ```typescript
@@ -1611,6 +2003,10 @@ setStorageSync({
1611
2003
 
1612
2004
  `Promise`\<`object`\>
1613
2005
 
2006
+ #### Remarks
2007
+
2008
+ 控制截屏或录屏时的视觉效果。
2009
+
1614
2010
  ***
1615
2011
 
1616
2012
  ### setWifiList()
@@ -1627,6 +2023,91 @@ setStorageSync({
1627
2023
 
1628
2024
  `Promise`\<`object`\>
1629
2025
 
2026
+ #### Remarks
2027
+
2028
+ 用于预设 Wi-Fi 列表。
2029
+
2030
+ ***
2031
+
2032
+ ### showActionSheet()
2033
+
2034
+ > **showActionSheet**(`params`): `Promise`\<[`ShowActionSheetResult`](doubao-apps-sdk-open-api.md#showactionsheetresult)\>
2035
+
2036
+ 显示操作菜单。
2037
+
2038
+ #### Parameters
2039
+
2040
+ • **params**: [`ShowActionSheetParams`](doubao-apps-sdk-open-api.md#showactionsheetparams)
2041
+
2042
+ #### Returns
2043
+
2044
+ `Promise`\<[`ShowActionSheetResult`](doubao-apps-sdk-open-api.md#showactionsheetresult)\>
2045
+
2046
+ #### Example
2047
+
2048
+ ```ts
2049
+ import { showActionSheet } from '@doubao-apps/framework/api';
2050
+
2051
+ const result = await showActionSheet({
2052
+ itemList: ['编辑', '删除']
2053
+ });
2054
+
2055
+ console.log(result.tapIndex);
2056
+ ```
2057
+
2058
+ ***
2059
+
2060
+ ### showLoading()
2061
+
2062
+ > **showLoading**(`params`?): `Promise`\<`object`\>
2063
+
2064
+ 显示 loading 提示框。
2065
+
2066
+ #### Parameters
2067
+
2068
+ • **params?**: [`ShowLoadingParams`](doubao-apps-sdk-open-api.md#showloadingparams)
2069
+
2070
+ #### Returns
2071
+
2072
+ `Promise`\<`object`\>
2073
+
2074
+ #### Remarks
2075
+
2076
+ 需调用 hideLoading 关闭。
2077
+
2078
+ ***
2079
+
2080
+ ### showModal()
2081
+
2082
+ > **showModal**(`params`): `Promise`\<[`ShowModalResult`](doubao-apps-sdk-open-api.md#showmodalresult)\>
2083
+
2084
+ 显示模态对话框。
2085
+
2086
+ #### Parameters
2087
+
2088
+ • **params**: [`ShowModalParams`](doubao-apps-sdk-open-api.md#showmodalparams)
2089
+
2090
+ #### Returns
2091
+
2092
+ `Promise`\<[`ShowModalResult`](doubao-apps-sdk-open-api.md#showmodalresult)\>
2093
+
2094
+ #### Example
2095
+
2096
+ ```ts
2097
+ import { showModal } from '@doubao-apps/framework/api';
2098
+
2099
+ const result = await showModal({
2100
+ title: '提示',
2101
+ content: '确认删除这条记录吗?',
2102
+ confirmText: '删除',
2103
+ cancelText: '取消'
2104
+ });
2105
+
2106
+ if (result.action === 'confirm') {
2107
+ console.log('用户确认删除');
2108
+ }
2109
+ ```
2110
+
1630
2111
  ***
1631
2112
 
1632
2113
  ### showToast()
@@ -1652,6 +2133,10 @@ setStorageSync({
1652
2133
 
1653
2134
  返回一个 Promise,在 Toast 显示结束时 resolve。
1654
2135
 
2136
+ #### Remarks
2137
+
2138
+ duration 和 icon 可控制提示表现。
2139
+
1655
2140
  #### Example
1656
2141
 
1657
2142
  ```typescript
@@ -1691,6 +2176,10 @@ showToast({
1691
2176
 
1692
2177
  `Promise`\<`object`\>
1693
2178
 
2179
+ #### Remarks
2180
+
2181
+ 需配对调用 stopAccelerometer。
2182
+
1694
2183
  ***
1695
2184
 
1696
2185
  ### startBeaconDiscovery()
@@ -1707,6 +2196,10 @@ showToast({
1707
2196
 
1708
2197
  `Promise`\<`object`\>
1709
2198
 
2199
+ #### Remarks
2200
+
2201
+ 需配对调用 stopBeaconDiscovery。
2202
+
1710
2203
  ***
1711
2204
 
1712
2205
  ### startBluetoothDevicesDiscovery()
@@ -1723,6 +2216,10 @@ showToast({
1723
2216
 
1724
2217
  `Promise`\<`object`\>
1725
2218
 
2219
+ #### Remarks
2220
+
2221
+ 通常先调用 openBluetoothAdapter。
2222
+
1726
2223
  ***
1727
2224
 
1728
2225
  ### startCompass()
@@ -1733,12 +2230,16 @@ showToast({
1733
2230
 
1734
2231
  #### Parameters
1735
2232
 
1736
- • **params?**: `Record`\<`string`, `never`\>
2233
+ • **params?**
1737
2234
 
1738
2235
  #### Returns
1739
2236
 
1740
2237
  `Promise`\<`object`\>
1741
2238
 
2239
+ #### Remarks
2240
+
2241
+ 需配对调用 stopCompass。
2242
+
1742
2243
  ***
1743
2244
 
1744
2245
  ### startDeviceMotionListening()
@@ -1755,6 +2256,10 @@ showToast({
1755
2256
 
1756
2257
  `Promise`\<`object`\>
1757
2258
 
2259
+ #### Remarks
2260
+
2261
+ 需配对调用 stopDeviceMotionListening。
2262
+
1758
2263
  ***
1759
2264
 
1760
2265
  ### startGyroscope()
@@ -1771,21 +2276,9 @@ showToast({
1771
2276
 
1772
2277
  `Promise`\<`object`\>
1773
2278
 
1774
- ***
2279
+ #### Remarks
1775
2280
 
1776
- ### startHCE()
1777
-
1778
- > **startHCE**(`params`): `Promise`\<`object`\>
1779
-
1780
- 开启 HCE。
1781
-
1782
- #### Parameters
1783
-
1784
- • **params**: [`StartHCEParams`](doubao-apps-sdk-open-api.md#starthceparams)
1785
-
1786
- #### Returns
1787
-
1788
- `Promise`\<`object`\>
2281
+ 需配对调用 stopGyroscope。
1789
2282
 
1790
2283
  ***
1791
2284
 
@@ -1797,12 +2290,16 @@ showToast({
1797
2290
 
1798
2291
  #### Parameters
1799
2292
 
1800
- • **params?**: `Record`\<`string`, `never`\>
2293
+ • **params?**
1801
2294
 
1802
2295
  #### Returns
1803
2296
 
1804
2297
  `Promise`\<`object`\>
1805
2298
 
2299
+ #### Remarks
2300
+
2301
+ Wi-Fi 流程入口。
2302
+
1806
2303
  ***
1807
2304
 
1808
2305
  ### stopAccelerometer()
@@ -1813,7 +2310,7 @@ showToast({
1813
2310
 
1814
2311
  #### Parameters
1815
2312
 
1816
- • **params?**: `Record`\<`string`, `never`\>
2313
+ • **params?**
1817
2314
 
1818
2315
  #### Returns
1819
2316
 
@@ -1829,7 +2326,7 @@ showToast({
1829
2326
 
1830
2327
  #### Parameters
1831
2328
 
1832
- • **params?**: `Record`\<`string`, `never`\>
2329
+ • **params?**
1833
2330
 
1834
2331
  #### Returns
1835
2332
 
@@ -1845,7 +2342,7 @@ showToast({
1845
2342
 
1846
2343
  #### Parameters
1847
2344
 
1848
- • **params?**: `Record`\<`string`, `never`\>
2345
+ • **params?**
1849
2346
 
1850
2347
  #### Returns
1851
2348
 
@@ -1861,7 +2358,7 @@ showToast({
1861
2358
 
1862
2359
  #### Parameters
1863
2360
 
1864
- • **params?**: `Record`\<`string`, `never`\>
2361
+ • **params?**
1865
2362
 
1866
2363
  #### Returns
1867
2364
 
@@ -1877,7 +2374,7 @@ showToast({
1877
2374
 
1878
2375
  #### Parameters
1879
2376
 
1880
- • **params?**: `Record`\<`string`, `never`\>
2377
+ • **params?**
1881
2378
 
1882
2379
  #### Returns
1883
2380
 
@@ -1893,7 +2390,7 @@ showToast({
1893
2390
 
1894
2391
  #### Parameters
1895
2392
 
1896
- • **params?**: `Record`\<`string`, `never`\>
2393
+ • **params?**
1897
2394
 
1898
2395
  #### Returns
1899
2396
 
@@ -1901,15 +2398,15 @@ showToast({
1901
2398
 
1902
2399
  ***
1903
2400
 
1904
- ### stopHCE()
2401
+ ### stopWifi()
1905
2402
 
1906
- > **stopHCE**(`params`?): `Promise`\<`object`\>
2403
+ > **stopWifi**(`params`?): `Promise`\<`object`\>
1907
2404
 
1908
- 停止 HCE。
2405
+ 关闭 Wi-Fi 模块。
1909
2406
 
1910
2407
  #### Parameters
1911
2408
 
1912
- • **params?**: `Record`\<`string`, `never`\>
2409
+ • **params?**
1913
2410
 
1914
2411
  #### Returns
1915
2412
 
@@ -1917,15 +2414,15 @@ showToast({
1917
2414
 
1918
2415
  ***
1919
2416
 
1920
- ### stopWifi()
2417
+ ### updateModelContext()
1921
2418
 
1922
- > **stopWifi**(`params`?): `Promise`\<`object`\>
2419
+ > **updateModelContext**(`params`?): `Promise`\<`object`\>
1923
2420
 
1924
- 关闭 Wi-Fi 模块。
2421
+ Agent 捐赠上下文
1925
2422
 
1926
2423
  #### Parameters
1927
2424
 
1928
- • **params?**: `Record`\<`string`, `never`\>
2425
+ • **params?**: [`UpdateModelContextParams`](doubao-apps-sdk-open-api.md#updatemodelcontextparams)
1929
2426
 
1930
2427
  #### Returns
1931
2428
 
@@ -1933,15 +2430,15 @@ showToast({
1933
2430
 
1934
2431
  ***
1935
2432
 
1936
- ### updateModelContext()
2433
+ ### updateWidget()
1937
2434
 
1938
- > **updateModelContext**(`params`?): `Promise`\<`object`\>
2435
+ > **updateWidget**(`params`): `Promise`\<`object`\>
1939
2436
 
1940
- 前端数据捐献接口:上报当前业务状态/关键信息(blocks)。
2437
+ 更新指定卡片
1941
2438
 
1942
2439
  #### Parameters
1943
2440
 
1944
- • **params?**: [`UpdateModelContextOptions`](doubao-apps-sdk-open-api.md#updatemodelcontextoptions)
2441
+ • **params**: [`UpdateWidgetParams`](doubao-apps-sdk-open-api.md#updatewidgetparams)
1945
2442
 
1946
2443
  #### Returns
1947
2444
 
@@ -1957,7 +2454,7 @@ showToast({
1957
2454
 
1958
2455
  #### Parameters
1959
2456
 
1960
- • **params?**: `Record`\<`string`, `never`\>
2457
+ • **params?**
1961
2458
 
1962
2459
  #### Returns
1963
2460
 
@@ -1995,6 +2492,34 @@ showToast({
1995
2492
 
1996
2493
  `Promise`\<`object`\>
1997
2494
 
2495
+ #### Remarks
2496
+
2497
+ value 需要是 ArrayBuffer。
2498
+
2499
+ ## Enumerations
2500
+
2501
+ ### ActionDirectiveType
2502
+
2503
+ #### Enumeration Members
2504
+
2505
+ ##### BUTTON\_CLICK
2506
+
2507
+ > **BUTTON\_CLICK**: `"button_click"`
2508
+
2509
+ 按钮点击
2510
+
2511
+ ##### FORM\_SUBMIT
2512
+
2513
+ > **FORM\_SUBMIT**: `"form_submit"`
2514
+
2515
+ 表单提交(复杂的信息提交场景)
2516
+
2517
+ ##### OPTION\_SELECT
2518
+
2519
+ > **OPTION\_SELECT**: `"option_select"`
2520
+
2521
+ 选择(下拉列表场景)
2522
+
1998
2523
  ## Interfaces
1999
2524
 
2000
2525
  ### AddPhoneCalendarParams
@@ -2583,75 +3108,297 @@ RSSI 信号强度,单位 dBm。
2583
3108
 
2584
3109
  #### Properties
2585
3110
 
2586
- ##### result
3111
+ ##### result
3112
+
3113
+ > **result**: `boolean`
3114
+
3115
+ ***
3116
+
3117
+ ### CheckIsOpenAccessibilityResult
3118
+
3119
+ 无障碍能力检测结果。
3120
+
3121
+ #### Properties
3122
+
3123
+ ##### open
3124
+
3125
+ > **open**: `boolean`
3126
+
3127
+ 是否开启视觉无障碍能力。
3128
+
3129
+ ***
3130
+
3131
+ ### ChooseContactResult
3132
+
3133
+ 选取联系人后的返回结果。
3134
+
3135
+ #### Properties
3136
+
3137
+ ##### displayName
3138
+
3139
+ > **displayName**: `string`
3140
+
3141
+ 联系人名称。
3142
+
3143
+ ##### phoneNumber
3144
+
3145
+ > **phoneNumber**: `string`
3146
+
3147
+ 选中的手机号。
3148
+
3149
+ ##### phoneNumberList
3150
+
3151
+ > **phoneNumberList**: `string`[]
3152
+
3153
+ 联系人所有手机号。
3154
+
3155
+ ***
3156
+
3157
+ ### ChooseImageFile
3158
+
3159
+ 选择图片返回的单个文件信息。
3160
+
3161
+ #### Properties
3162
+
3163
+ ##### originalFileObj?
3164
+
3165
+ > `optional` **originalFileObj**: `File`
3166
+
3167
+ 原始浏览器 File 对象。
3168
+
3169
+ ##### path
3170
+
3171
+ > **path**: `string`
3172
+
3173
+ 本地临时文件路径。
3174
+
3175
+ ##### size
3176
+
3177
+ > **size**: `number`
3178
+
3179
+ 文件大小,单位 B。
3180
+
3181
+ ##### type?
3182
+
3183
+ > `optional` **type**: `string`
3184
+
3185
+ 文件 MIME 类型。
3186
+
3187
+ ***
3188
+
3189
+ ### ChooseImageParams
3190
+
3191
+ 选择图片的请求参数。
3192
+
3193
+ #### Properties
3194
+
3195
+ ##### count?
3196
+
3197
+ > `optional` **count**: `number`
3198
+
3199
+ 最多可选图片张数。
3200
+
3201
+ ##### imageId?
3202
+
3203
+ > `optional` **imageId**: `string`
3204
+
3205
+ H5 场景下可复用的 input 元素 ID。
3206
+
3207
+ ##### sizeType?
3208
+
3209
+ > `optional` **sizeType**: [`ChooseImageSizeType`](doubao-apps-sdk-open-api.md#chooseimagesizetype)[]
3210
+
3211
+ 允许返回的图片尺寸类型。
3212
+
3213
+ ##### sourceType?
3214
+
3215
+ > `optional` **sourceType**: [`ChooseImageSourceType`](doubao-apps-sdk-open-api.md#chooseimagesourcetype)[]
3216
+
3217
+ 允许选择的图片来源。
3218
+
3219
+ ***
3220
+
3221
+ ### ChooseImageResult
3222
+
3223
+ 选择图片结果。
3224
+
3225
+ #### Properties
3226
+
3227
+ ##### tempFilePaths
3228
+
3229
+ > **tempFilePaths**: `string`[]
3230
+
3231
+ 图片临时文件路径列表。
3232
+
3233
+ ##### tempFiles
3234
+
3235
+ > **tempFiles**: [`ChooseImageFile`](doubao-apps-sdk-open-api.md#chooseimagefile)[]
3236
+
3237
+ 图片临时文件信息列表。
3238
+
3239
+ ***
3240
+
3241
+ ### ChooseMessageFile
3242
+
3243
+ 选择消息文件返回的单个文件信息。
3244
+
3245
+ #### Properties
3246
+
3247
+ ##### name
3248
+
3249
+ > **name**: `string`
3250
+
3251
+ 文件名称。
3252
+
3253
+ ##### path
3254
+
3255
+ > **path**: `string`
3256
+
3257
+ 本地临时文件路径。
3258
+
3259
+ ##### size
3260
+
3261
+ > **size**: `number`
3262
+
3263
+ 文件大小,单位 B。
3264
+
3265
+ ##### time
3266
+
3267
+ > **time**: `number`
3268
+
3269
+ 会话发送时间,Unix 时间戳。
3270
+
3271
+ ##### type
3272
+
3273
+ > **type**: [`SelectedMessageFileType`](doubao-apps-sdk-open-api.md#selectedmessagefiletype)
3274
+
3275
+ 文件类型。
3276
+
3277
+ ***
3278
+
3279
+ ### ChooseMessageFileParams
3280
+
3281
+ 选择消息文件的请求参数。
3282
+
3283
+ #### Properties
3284
+
3285
+ ##### count
3286
+
3287
+ > **count**: `number`
3288
+
3289
+ 最多可选文件个数。
3290
+
3291
+ ##### extension?
3292
+
3293
+ > `optional` **extension**: `string`[]
3294
+
3295
+ 基于文件扩展名的过滤条件,仅在 `type` 为 `file` 时生效。
3296
+
3297
+ ##### type?
3298
+
3299
+ > `optional` **type**: [`ChooseMessageFileType`](doubao-apps-sdk-open-api.md#choosemessagefiletype)
3300
+
3301
+ 允许选择的文件类型。
3302
+
3303
+ ***
3304
+
3305
+ ### ChooseMessageFileResult
3306
+
3307
+ 选择消息文件结果。
3308
+
3309
+ #### Properties
3310
+
3311
+ ##### tempFiles
3312
+
3313
+ > **tempFiles**: [`ChooseMessageFile`](doubao-apps-sdk-open-api.md#choosemessagefile)[]
3314
+
3315
+ 本地临时文件对象数组。
3316
+
3317
+ ***
3318
+
3319
+ ### CloseBLEConnectionParams
3320
+
3321
+ 关闭 BLE 连接的请求参数。
3322
+
3323
+ #### Properties
3324
+
3325
+ ##### deviceId
3326
+
3327
+ > **deviceId**: `string`
3328
+
3329
+ 蓝牙设备 ID。
3330
+
3331
+ ***
3332
+
3333
+ ### CloseParams
3334
+
3335
+ #### Properties
3336
+
3337
+ ##### containerID?
2587
3338
 
2588
- > **result**: `boolean`
3339
+ > `optional` **containerID**: `string`
3340
+
3341
+ 指定一个要关闭的页面
2589
3342
 
2590
3343
  ***
2591
3344
 
2592
- ### CheckIsOpenAccessibilityResult
3345
+ ### CompassChangeEvent
2593
3346
 
2594
- 无障碍能力检测结果。
3347
+ 罗盘数据变化事件。
2595
3348
 
2596
3349
  #### Properties
2597
3350
 
2598
- ##### open
3351
+ ##### direction
2599
3352
 
2600
- > **open**: `boolean`
3353
+ > **direction**: `number`
2601
3354
 
2602
- 是否开启视觉无障碍能力。
3355
+ 面对的方向度数,范围 0 到 360。
2603
3356
 
2604
3357
  ***
2605
3358
 
2606
- ### ChooseContactResult
3359
+ ### CompressImageParams
2607
3360
 
2608
- 选取联系人后的返回结果。
3361
+ 压缩图片的请求参数。
2609
3362
 
2610
3363
  #### Properties
2611
3364
 
2612
- ##### displayName
2613
-
2614
- > **displayName**: `string`
2615
-
2616
- 联系人名称。
2617
-
2618
- ##### phoneNumber
2619
-
2620
- > **phoneNumber**: `string`
3365
+ ##### compressedHeight?
2621
3366
 
2622
- 选中的手机号。
3367
+ > `optional` **compressedHeight**: `number`
2623
3368
 
2624
- ##### phoneNumberList
3369
+ 压缩后图片高度,单位 px。
2625
3370
 
2626
- > **phoneNumberList**: `string`[]
3371
+ ##### compressedWidth?
2627
3372
 
2628
- 联系人所有手机号。
3373
+ > `optional` **compressedWidth**: `number`
2629
3374
 
2630
- ***
3375
+ 压缩后图片宽度,单位 px。
2631
3376
 
2632
- ### CloseBLEConnectionParams
3377
+ ##### quality?
2633
3378
 
2634
- 关闭 BLE 连接的请求参数。
3379
+ > `optional` **quality**: `number`
2635
3380
 
2636
- #### Properties
3381
+ 压缩质量,范围 0 - 100,仅对 jpg 生效。
2637
3382
 
2638
- ##### deviceId
3383
+ ##### src
2639
3384
 
2640
- > **deviceId**: `string`
3385
+ > **src**: `string`
2641
3386
 
2642
- 蓝牙设备 ID。
3387
+ 图片路径。
2643
3388
 
2644
3389
  ***
2645
3390
 
2646
- ### CloseParams
3391
+ ### CompressImageResult
3392
+
3393
+ 压缩图片结果。
2647
3394
 
2648
3395
  #### Properties
2649
3396
 
2650
- ##### containerID?
3397
+ ##### tempFilePath
2651
3398
 
2652
- > `optional` **containerID**: `string`
3399
+ > **tempFilePath**: `string`
2653
3400
 
2654
- 指定一个要关闭的页面
3401
+ 压缩后图片的临时文件路径。
2655
3402
 
2656
3403
  ***
2657
3404
 
@@ -2733,6 +3480,30 @@ Wi-Fi SSID。
2733
3480
 
2734
3481
  ***
2735
3482
 
3483
+ ### DispatchActionDirectiveParams
3484
+
3485
+ #### Properties
3486
+
3487
+ ##### actionDescribe
3488
+
3489
+ > **actionDescribe**: `string`
3490
+
3491
+ 自然语言描述,例如:用户点击支付按钮并完成话费支付
3492
+
3493
+ ##### actionType
3494
+
3495
+ > **actionType**: [`ActionDirectiveType`](doubao-apps-sdk-open-api.md#actiondirectivetype)
3496
+
3497
+ 动作类型,参见 [ActionDirectiveType](doubao-apps-sdk-open-api.md#actiondirectivetype)
3498
+
3499
+ ##### widgetInstanceId
3500
+
3501
+ > **widgetInstanceId**: `string`
3502
+
3503
+ 会话消息关联的卡片ID
3504
+
3505
+ ***
3506
+
2736
3507
  ### DoubaoAppAccountInfo
2737
3508
 
2738
3509
  豆包 App 账号信息。
@@ -2763,6 +3534,20 @@ Wi-Fi SSID。
2763
3534
 
2764
3535
  ***
2765
3536
 
3537
+ ### EnableAlertBeforeUnloadParams
3538
+
3539
+ 开启返回前提醒的参数。
3540
+
3541
+ #### Properties
3542
+
3543
+ ##### message
3544
+
3545
+ > **message**: `string`
3546
+
3547
+ 返回前确认弹窗的文案。
3548
+
3549
+ ***
3550
+
2766
3551
  ### GetAccountInfoResult
2767
3552
 
2768
3553
  获取当前账号信息。
@@ -3087,6 +3872,58 @@ RSSI 信号强度,单位 dBm。
3087
3872
 
3088
3873
  ***
3089
3874
 
3875
+ ### GetImageInfoParams
3876
+
3877
+ 获取图片信息的请求参数。
3878
+
3879
+ #### Properties
3880
+
3881
+ ##### src
3882
+
3883
+ > **src**: `string`
3884
+
3885
+ 图片路径,可以是相对路径、临时文件路径、存储文件路径或网络图片路径。
3886
+
3887
+ ***
3888
+
3889
+ ### GetImageInfoResult
3890
+
3891
+ 图片信息结果。
3892
+
3893
+ #### Properties
3894
+
3895
+ ##### height
3896
+
3897
+ > **height**: `number`
3898
+
3899
+ 图片原始高度,单位 px,不考虑旋转。
3900
+
3901
+ ##### orientation
3902
+
3903
+ > **orientation**: [`ImageOrientation`](doubao-apps-sdk-open-api.md#imageorientation)
3904
+
3905
+ 图片方向。
3906
+
3907
+ ##### path
3908
+
3909
+ > **path**: `string`
3910
+
3911
+ 图片的本地路径。
3912
+
3913
+ ##### type
3914
+
3915
+ > **type**: `string`
3916
+
3917
+ 图片格式。
3918
+
3919
+ ##### width
3920
+
3921
+ > **width**: `number`
3922
+
3923
+ 图片原始宽度,单位 px,不考虑旋转。
3924
+
3925
+ ***
3926
+
3090
3927
  ### GetLocalIPAddressResult
3091
3928
 
3092
3929
  获取局域网 IP 的返回结果。
@@ -3198,7 +4035,7 @@ RSSI 信号强度,单位 dBm。
3198
4035
 
3199
4036
  ##### networkType
3200
4037
 
3201
- > **networkType**: [`NetworkType`](doubao-apps-sdk-open-api.md#networktype-1)
4038
+ > **networkType**: [`NetworkType`](doubao-apps-sdk-open-api.md#networktype-2)
3202
4039
 
3203
4040
  当前网络类型。
3204
4041
 
@@ -3352,6 +4189,36 @@ key 对应的数据
3352
4189
 
3353
4190
  ***
3354
4191
 
4192
+ ### GetSystemSettingResult
4193
+
4194
+ #### Properties
4195
+
4196
+ ##### bluetoothEnabled
4197
+
4198
+ > **bluetoothEnabled**: `boolean`
4199
+
4200
+ 蓝牙的系统开关
4201
+
4202
+ ##### deviceOrientation
4203
+
4204
+ > **deviceOrientation**: [`DeviceOrientation`](doubao-apps-sdk-open-api.md#deviceorientation-1)
4205
+
4206
+ 设备方向
4207
+
4208
+ ##### locationEnabled
4209
+
4210
+ > **locationEnabled**: `boolean`
4211
+
4212
+ 地理位置的系统开关
4213
+
4214
+ ##### wifiEnabled
4215
+
4216
+ > **wifiEnabled**: `boolean`
4217
+
4218
+ Wi-Fi 的系统开关
4219
+
4220
+ ***
4221
+
3355
4222
  ### GetWifiListResult
3356
4223
 
3357
4224
  获取 Wi-Fi 列表的返回结果。
@@ -3420,6 +4287,12 @@ key 对应的数据
3420
4287
 
3421
4288
  ***
3422
4289
 
4290
+ ### HideInteractionParams
4291
+
4292
+ 隐藏交互提示框的公共参数。
4293
+
4294
+ ***
4295
+
3423
4296
  ### IsBluetoothDevicePairedParams
3424
4297
 
3425
4298
  查询蓝牙设备配对状态的请求参数。
@@ -3476,7 +4349,7 @@ Login credential code
3476
4349
 
3477
4350
  ##### loginType
3478
4351
 
3479
- > **loginType**: `LoginType`
4352
+ > **loginType**: [`LoginType`](doubao-apps-sdk-open-api.md#logintype-1)
3480
4353
 
3481
4354
  Login type identifier
3482
4355
 
@@ -3532,6 +4405,50 @@ Whether the login is successful
3532
4405
 
3533
4406
  ***
3534
4407
 
4408
+ ### MenuButtonBoundingClientRect
4409
+
4410
+ 菜单按钮的布局位置信息。
4411
+
4412
+ #### Properties
4413
+
4414
+ ##### bottom
4415
+
4416
+ > **bottom**: `number`
4417
+
4418
+ 下边界坐标,单位 px。
4419
+
4420
+ ##### height
4421
+
4422
+ > **height**: `number`
4423
+
4424
+ 高度,单位 px。
4425
+
4426
+ ##### left
4427
+
4428
+ > **left**: `number`
4429
+
4430
+ 左边界坐标,单位 px。
4431
+
4432
+ ##### right
4433
+
4434
+ > **right**: `number`
4435
+
4436
+ 右边界坐标,单位 px。
4437
+
4438
+ ##### top
4439
+
4440
+ > **top**: `number`
4441
+
4442
+ 上边界坐标,单位 px。
4443
+
4444
+ ##### width
4445
+
4446
+ > **width**: `number`
4447
+
4448
+ 宽度,单位 px。
4449
+
4450
+ ***
4451
+
3535
4452
  ### NavigateBackParams
3536
4453
 
3537
4454
  #### Properties
@@ -3556,6 +4473,26 @@ Whether the login is successful
3556
4473
 
3557
4474
  ***
3558
4475
 
4476
+ ### NetworkStatusChangeEvent
4477
+
4478
+ 网络状态变化事件。
4479
+
4480
+ #### Properties
4481
+
4482
+ ##### isConnected
4483
+
4484
+ > **isConnected**: `boolean`
4485
+
4486
+ 当前是否有可用网络连接。
4487
+
4488
+ ##### networkType
4489
+
4490
+ > **networkType**: [`NetworkType`](doubao-apps-sdk-open-api.md#networktype-2)
4491
+
4492
+ 当前网络类型。
4493
+
4494
+ ***
4495
+
3559
4496
  ### NotifyBLECharacteristicValueChangeParams
3560
4497
 
3561
4498
  订阅 BLE 特征值变化的请求参数。
@@ -3592,93 +4529,183 @@ Whether the login is successful
3592
4529
 
3593
4530
  订阅类型。
3594
4531
 
3595
- ***
4532
+ ***
4533
+
4534
+ ### OpenAppRequest
4535
+
4536
+ #### Properties
4537
+
4538
+ ##### fallbackUrl?
4539
+
4540
+ > `optional` **fallbackUrl**: `string`
4541
+
4542
+ Optional fallback URL when deep link fails
4543
+
4544
+ ##### targetPackage?
4545
+
4546
+ > `optional` **targetPackage**: `string`
4547
+
4548
+ Optional target package name for Android
4549
+
4550
+ ##### uri
4551
+
4552
+ > **uri**: `string`
4553
+
4554
+ Target URI to open, e.g. scheme://path?query
4555
+
4556
+ ***
4557
+
4558
+ ### OpenAppResult
4559
+
4560
+ #### Properties
4561
+
4562
+ ##### status
4563
+
4564
+ > **status**: [`OpenAppStatus`](doubao-apps-sdk-open-api.md#openappstatus)
4565
+
4566
+ Execution status from client
4567
+
4568
+ ***
4569
+
4570
+ ### OpenBluetoothAdapterParams
4571
+
4572
+ 打开蓝牙适配器的请求参数。
4573
+
4574
+ #### Properties
4575
+
4576
+ ##### mode?
4577
+
4578
+ > `optional` **mode**: [`BluetoothAdapterMode`](doubao-apps-sdk-open-api.md#bluetoothadaptermode)
4579
+
4580
+ 蓝牙模式。
4581
+
4582
+ ***
4583
+
4584
+ ### PluginAccountInfo
4585
+
4586
+ 插件账号信息(仅在插件中调用时包含)。
4587
+
4588
+ #### Properties
4589
+
4590
+ ##### appId
4591
+
4592
+ > **appId**: `string`
4593
+
4594
+ 插件 appId
4595
+
4596
+ ##### version
4597
+
4598
+ > **version**: `string`
4599
+
4600
+ 插件版本号,'a.b.c' 形式
4601
+
4602
+ ***
4603
+
4604
+ ### PostLoginResultRequest
4605
+
4606
+ #### Properties
4607
+
4608
+ ##### code?
4609
+
4610
+ > `optional` **code**: `string`
4611
+
4612
+ Authorization login credential, valid when login result is true
4613
+
4614
+ ##### result
4615
+
4616
+ > **result**: `boolean`
3596
4617
 
3597
- ### OpenAppRequest
4618
+ Login result, true means success, false means failure
3598
4619
 
3599
- #### Properties
4620
+ ***
3600
4621
 
3601
- ##### fallbackUrl?
4622
+ ### PreviewImageParams
3602
4623
 
3603
- > `optional` **fallbackUrl**: `string`
4624
+ 预览图片的请求参数。
3604
4625
 
3605
- Optional fallback URL when deep link fails
4626
+ #### Properties
3606
4627
 
3607
- ##### targetPackage?
4628
+ ##### current?
3608
4629
 
3609
- > `optional` **targetPackage**: `string`
4630
+ > `optional` **current**: `string` \| `number`
3610
4631
 
3611
- Optional target package name for Android
4632
+ 当前显示图片的链接,或当前显示图片的下标,不填则默认为 urls 中的第一张
3612
4633
 
3613
- ##### uri
4634
+ ##### referrerPolicy?
3614
4635
 
3615
- > **uri**: `string`
4636
+ > `optional` **referrerPolicy**: `string`
3616
4637
 
3617
- Target URI to open, e.g. scheme://path?query
4638
+ 预览页使用的 Referrer 策略。
3618
4639
 
3619
- ***
4640
+ ##### showmenu?
3620
4641
 
3621
- ### OpenAppResult
4642
+ > `optional` **showmenu**: `boolean`
3622
4643
 
3623
- #### Properties
4644
+ 是否显示长按菜单,菜单支持保存图片至本地相册
3624
4645
 
3625
- ##### status
4646
+ ##### urls
3626
4647
 
3627
- > **status**: [`OpenAppStatus`](doubao-apps-sdk-open-api.md#openappstatus)
4648
+ > **urls**: `string`[]
3628
4649
 
3629
- Execution status from client
4650
+ 需要预览的图片链接列表。
3630
4651
 
3631
4652
  ***
3632
4653
 
3633
- ### OpenBluetoothAdapterParams
4654
+ ### PreviewMediaParams
3634
4655
 
3635
- 打开蓝牙适配器的请求参数。
4656
+ 预览图片和视频的请求参数。
3636
4657
 
3637
4658
  #### Properties
3638
4659
 
3639
- ##### mode?
3640
-
3641
- > `optional` **mode**: [`BluetoothAdapterMode`](doubao-apps-sdk-open-api.md#bluetoothadaptermode)
4660
+ ##### current?
3642
4661
 
3643
- 蓝牙模式。
4662
+ > `optional` **current**: `number`
3644
4663
 
3645
- ***
4664
+ 当前显示资源的下标。
3646
4665
 
3647
- ### PluginAccountInfo
4666
+ ##### referrerPolicy?
3648
4667
 
3649
- 插件账号信息(仅在插件中调用时包含)。
4668
+ > `optional` **referrerPolicy**: `string`
3650
4669
 
3651
- #### Properties
4670
+ 预览页使用的 Referrer 策略。
3652
4671
 
3653
- ##### appId
4672
+ ##### showmenu?
3654
4673
 
3655
- > **appId**: `string`
4674
+ > `optional` **showmenu**: `boolean`
3656
4675
 
3657
- 插件 appId
4676
+ 是否显示长按菜单。
3658
4677
 
3659
- ##### version
4678
+ ##### sources
3660
4679
 
3661
- > **version**: `string`
4680
+ > **sources**: [`PreviewMediaSource`](doubao-apps-sdk-open-api.md#previewmediasource)[]
3662
4681
 
3663
- 插件版本号,'a.b.c' 形式
4682
+ 需要预览的资源列表。
3664
4683
 
3665
4684
  ***
3666
4685
 
3667
- ### PostLoginResultRequest
4686
+ ### PreviewMediaSource
4687
+
4688
+ 预览媒体资源项。
3668
4689
 
3669
4690
  #### Properties
3670
4691
 
3671
- ##### code?
4692
+ ##### poster?
3672
4693
 
3673
- > `optional` **code**: `string`
4694
+ > `optional` **poster**: `string`
3674
4695
 
3675
- Authorization login credential, valid when login result is true
4696
+ 视频封面图地址。
3676
4697
 
3677
- ##### result
4698
+ ##### type?
3678
4699
 
3679
- > **result**: `boolean`
4700
+ > `optional` **type**: `"image"` \| `"video"`
3680
4701
 
3681
- Login result, true means success, false means failure
4702
+ 资源类型。
4703
+
4704
+ ##### url
4705
+
4706
+ > **url**: `string`
4707
+
4708
+ 图片或视频的地址。
3682
4709
 
3683
4710
  ***
3684
4711
 
@@ -3768,7 +4795,7 @@ Whether user authorization for privacy agreement is required
3768
4795
 
3769
4796
  ##### data?
3770
4797
 
3771
- > `optional` **data**: `string` \| `ArrayBuffer` \| `Record`\<`string`, `any`\>
4798
+ > `optional` **data**: `string` \| `Record`\<`string`, `any`\> \| `ArrayBuffer`
3772
4799
 
3773
4800
  请求体数据。
3774
4801
 
@@ -3833,7 +4860,7 @@ Whether user authorization for privacy agreement is required
3833
4860
 
3834
4861
  ##### data?
3835
4862
 
3836
- > `optional` **data**: `string` \| `ArrayBuffer` \| `Record`\<`string`, `any`\>
4863
+ > `optional` **data**: `string` \| `Record`\<`string`, `any`\> \| `ArrayBuffer`
3837
4864
 
3838
4865
  响应数据,类型由 `dataType` 决定。
3839
4866
 
@@ -3851,6 +4878,20 @@ HTTP 状态码。
3851
4878
 
3852
4879
  ***
3853
4880
 
4881
+ ### SaveImageToPhotosAlbumParams
4882
+
4883
+ 保存图片到系统相册的请求参数。
4884
+
4885
+ #### Properties
4886
+
4887
+ ##### filePath
4888
+
4889
+ > **filePath**: `string`
4890
+
4891
+ 需要保存的图片文件路径。支持临时文件路径或持久文件路径,不支持网络图片路径。
4892
+
4893
+ ***
4894
+
3854
4895
  ### ScanCodeParams
3855
4896
 
3856
4897
  扫码请求参数。
@@ -3909,20 +4950,6 @@ HTTP 状态码。
3909
4950
 
3910
4951
  ***
3911
4952
 
3912
- ### SendHCEMessageParams
3913
-
3914
- 发送 HCE 消息的请求参数。
3915
-
3916
- #### Properties
3917
-
3918
- ##### data
3919
-
3920
- > **data**: `ArrayBuffer`
3921
-
3922
- 要发送的二进制数据。
3923
-
3924
- ***
3925
-
3926
4953
  ### SendQueryMessageParams
3927
4954
 
3928
4955
  #### Properties
@@ -3961,6 +4988,24 @@ HTTP 状态码。
3961
4988
 
3962
4989
  ***
3963
4990
 
4991
+ ### SetAdditionalContextParams
4992
+
4993
+ #### Properties
4994
+
4995
+ ##### additionalContext
4996
+
4997
+ > **additionalContext**: `string`
4998
+
4999
+ 上下文内容
5000
+
5001
+ ##### botId?
5002
+
5003
+ > `optional` **botId**: `string`
5004
+
5005
+ 指定 bot id
5006
+
5007
+ ***
5008
+
3964
5009
  ### SetBLEMTUParams
3965
5010
 
3966
5011
  设置 BLE MTU 的请求参数。
@@ -4085,6 +5130,110 @@ HTTP 状态码。
4085
5130
 
4086
5131
  ***
4087
5132
 
5133
+ ### ShowActionSheetParams
5134
+
5135
+ 显示操作菜单的参数。
5136
+
5137
+ #### Properties
5138
+
5139
+ ##### itemColor?
5140
+
5141
+ > `optional` **itemColor**: `string`
5142
+
5143
+ 按钮文字颜色。
5144
+
5145
+ ##### itemList
5146
+
5147
+ > **itemList**: `string`[]
5148
+
5149
+ 按钮文字数组。
5150
+
5151
+ ##### title?
5152
+
5153
+ > `optional` **title**: `string`
5154
+
5155
+ 标题
5156
+
5157
+ ***
5158
+
5159
+ ### ShowActionSheetResult
5160
+
5161
+ 显示操作菜单的返回结果。
5162
+
5163
+ #### Properties
5164
+
5165
+ ##### tapIndex
5166
+
5167
+ > **tapIndex**: `number`
5168
+
5169
+ 用户点击的按钮序号,从 0 开始。
5170
+
5171
+ ***
5172
+
5173
+ ### ShowLoadingParams
5174
+
5175
+ 显示 loading 提示框的参数。
5176
+
5177
+ ***
5178
+
5179
+ ### ShowModalParams
5180
+
5181
+ 显示模态对话框的参数。
5182
+
5183
+ #### Properties
5184
+
5185
+ ##### cancelText?
5186
+
5187
+ > `optional` **cancelText**: `string`
5188
+
5189
+ 取消按钮的文字。
5190
+
5191
+ ##### confirmText?
5192
+
5193
+ > `optional` **confirmText**: `string`
5194
+
5195
+ 确认按钮的文字。
5196
+
5197
+ ##### content
5198
+
5199
+ > **content**: `string`
5200
+
5201
+ 模态对话框的内容。
5202
+
5203
+ ##### showCancel?
5204
+
5205
+ > `optional` **showCancel**: `boolean`
5206
+
5207
+ 是否显示取消按钮,默认 `true`。
5208
+
5209
+ ##### tapMaskToDismiss?
5210
+
5211
+ > `optional` **tapMaskToDismiss**: `boolean`
5212
+
5213
+ 是否允许点击蒙层关闭对话框,默认 `false`。
5214
+
5215
+ ##### title?
5216
+
5217
+ > `optional` **title**: `string`
5218
+
5219
+ 模态对话框的标题。
5220
+
5221
+ ***
5222
+
5223
+ ### ShowModalResult
5224
+
5225
+ 显示模态对话框的返回结果。
5226
+
5227
+ #### Properties
5228
+
5229
+ ##### action
5230
+
5231
+ > **action**: `"confirm"` \| `"cancel"` \| `"mask"`
5232
+
5233
+ 用户点击的动作。
5234
+
5235
+ ***
5236
+
4088
5237
  ### ShowToastParams
4089
5238
 
4090
5239
  #### Properties
@@ -4205,114 +5354,57 @@ iOS 下是否忽略蓝牙可用性校验。
4205
5354
 
4206
5355
  ***
4207
5356
 
4208
- ### StartHCEParams
4209
-
4210
- 开启 HCE 的请求参数。
5357
+ ### UpdateModelContextParams
4211
5358
 
4212
5359
  #### Properties
4213
5360
 
4214
- ##### aidList
4215
-
4216
- > **aidList**: `string`[]
5361
+ ##### content?
4217
5362
 
4218
- 需要注册到系统的 AID 列表。
5363
+ > `optional` **content**: `string`
4219
5364
 
4220
- ***
5365
+ 上下文内容,格式无约束,可以与 MCP 服务下发的上下文格式保持一致
4221
5366
 
4222
- ### UpdateModelContextEntityBlock
5367
+ ##### entityId?
4223
5368
 
4224
- #### Properties
5369
+ > `optional` **entityId**: `string`
4225
5370
 
4226
- ##### entities
5371
+ 上下文所属的 entityID,业务侧管理
4227
5372
 
4228
- > **entities**: `Record`\<`string`, `any`\>[]
5373
+ ##### taskId?
4229
5374
 
4230
- ##### type
5375
+ > `optional` **taskId**: `string`
4231
5376
 
4232
- > **type**: `"entity"`
5377
+ 上下文所属任务 ID,业务侧定义
4233
5378
 
4234
5379
  ***
4235
5380
 
4236
- ### UpdateModelContextOptions
4237
-
4238
- 前端数据捐献接口入参。
4239
-
4240
- 用于把“当前业务状态/关键信息”以统一 blocks 结构上报给端侧。
4241
-
4242
- 建议触发时机:
4243
- - 关键状态变化:例如订单创建/接单/到达/完成
4244
- - 关键 UI 展示:例如弹出重要提示、展示核心摘要
4245
-
4246
- #### Example
4247
-
4248
- ```ts
4249
- await updateModelContext({
4250
- entity_meta: {
4251
- mcpServer: 'caocao',
4252
- data_type: '',
4253
- create_time: '2026-01-05 10:00:00',
4254
- expire_at: '2026-01-05 10:00:00',
4255
- update_url: 'uri://data/taxi/1',
4256
- annotation: {
4257
- hostRestartKeep: true,
4258
- systemRestartKeep: true
4259
- }
4260
- },
4261
- content: [
4262
- {
4263
- type: 'summary',
4264
- text: '王师傅已到达上车点,请尽快上车,车牌京A12345'
4265
- },
4266
- {
4267
- type: 'entity',
4268
- entities: [
4269
- {
4270
- orderId: '$E_17',
4271
- status: '待提交',
4272
- channel: 'personal'
4273
- }
4274
- ]
4275
- }
4276
- ]
4277
- });
4278
- ```
5381
+ ### UpdateWidgetParams
4279
5382
 
4280
5383
  #### Properties
4281
5384
 
4282
- ##### content?
4283
-
4284
- > `optional` **content**: [`UpdateModelContextBlock`](doubao-apps-sdk-open-api.md#updatemodelcontextblock)[]
5385
+ ##### widgetData
4285
5386
 
4286
- blocks 数组,支持 summary/entity 混搭。
4287
- - 顺序不做强约束;建议把 summary 放前面,便于人类阅读。
4288
- - 端侧生成稳定 event_id 时,会从所有 blocks 扫描 type="entity" 的 entities 来提取业务 identity(与顺序无关)。
5387
+ > **widgetData**: `string`
4289
5388
 
4290
- ##### entity\_meta?
5389
+ 卡片渲染的数据
4291
5390
 
4292
- > `optional` **entity\_meta**: `Record`\<`string`, `any`\>
5391
+ ##### widgetId?
4293
5392
 
4294
- 可选:业务侧补充元信息(如来源、去重锚点、时序、过期策略等)。
5393
+ > `optional` **widgetId**: `string`
4295
5394
 
4296
- 字段示例:
4297
- - mcpServer: 数据来源 app(例如 caocao)
4298
- - create_time: 业务侧数据发生时间(用于时序)
4299
- - expire_at: 业务侧过期时间(过期后模型不再使用;第一期可能未强制生效)
4300
- - update_url: 预留字段(第一期暂不支持)
4301
- - annotation.hostRestartKeep/systemRestartKeep: 预留字段(第一期可能未强制生效)
5395
+ 卡片更新的为新的widgetId
4302
5396
 
4303
- ***
4304
-
4305
- ### UpdateModelContextSummaryBlock
5397
+ ##### widgetInstanceId
4306
5398
 
4307
- #### Properties
5399
+ > **widgetInstanceId**: `string`
4308
5400
 
4309
- ##### text
5401
+ 需要更新的widget 实例 ID
4310
5402
 
4311
- > **text**: `string`
5403
+ ***
4312
5404
 
4313
- ##### type
5405
+ ### UserCaptureScreenEvent
4314
5406
 
4315
- > **type**: `"summary"`
5407
+ 用户主动截屏事件。
4316
5408
 
4317
5409
  ***
4318
5410
 
@@ -4530,6 +5622,89 @@ iBeacon 距离等级。
4530
5622
 
4531
5623
  ***
4532
5624
 
5625
+ ### ChooseImageSizeType
5626
+
5627
+ > **ChooseImageSizeType**: `"original"` \| `"compressed"`
5628
+
5629
+ 可选的图片尺寸类型。
5630
+
5631
+ ***
5632
+
5633
+ ### ChooseImageSourceType
5634
+
5635
+ > **ChooseImageSourceType**: `"album"` \| `"camera"` \| `"user"` \| `"environment"`
5636
+
5637
+ 可选的图片来源类型。
5638
+
5639
+ ***
5640
+
5641
+ ### ChooseMessageFileType
5642
+
5643
+ > **ChooseMessageFileType**: `"all"` \| `"video"` \| `"image"` \| `"file"`
5644
+
5645
+ 选择消息文件的文件类型。
5646
+
5647
+ ***
5648
+
5649
+ ### CompassChangeListener()
5650
+
5651
+ > **CompassChangeListener**: (`event`) => `void`
5652
+
5653
+ 罗盘数据变化事件监听函数。
5654
+
5655
+ #### Parameters
5656
+
5657
+ • **event**: [`CompassChangeEvent`](doubao-apps-sdk-open-api.md#compasschangeevent)
5658
+
5659
+ #### Returns
5660
+
5661
+ `void`
5662
+
5663
+ ***
5664
+
5665
+ ### DeviceOrientation
5666
+
5667
+ > **DeviceOrientation**: `"portrait"` \| `"landscape"`
5668
+
5669
+ ***
5670
+
5671
+ ### ImageOrientation
5672
+
5673
+ > **ImageOrientation**: `"up"` \| `"up-mirrored"` \| `"down"` \| `"down-mirrored"` \| `"left-mirrored"` \| `"right"` \| `"right-mirrored"` \| `"left"`
5674
+
5675
+ 图片方向枚举。
5676
+
5677
+ ***
5678
+
5679
+ ### LoginType
5680
+
5681
+ > **LoginType**: `0` \| `1` \| `2` \| `3`
5682
+
5683
+ Widget 登录类型。
5684
+
5685
+ - `0`: 隐私协议登录
5686
+ - `1`: 仅登录
5687
+ - `2`: 先登录再隐私协议,两次弹窗
5688
+ - `3`: 登录和隐私协议合并,一次弹窗
5689
+
5690
+ ***
5691
+
5692
+ ### NetworkStatusChangeListener()
5693
+
5694
+ > **NetworkStatusChangeListener**: (`event`) => `void`
5695
+
5696
+ 网络状态变化事件监听函数。
5697
+
5698
+ #### Parameters
5699
+
5700
+ • **event**: [`NetworkStatusChangeEvent`](doubao-apps-sdk-open-api.md#networkstatuschangeevent)
5701
+
5702
+ #### Returns
5703
+
5704
+ `void`
5705
+
5706
+ ***
5707
+
4533
5708
  ### NetworkType
4534
5709
 
4535
5710
  > **NetworkType**: `"wifi"` \| `"2g"` \| `"3g"` \| `"4g"` \| `"5g"` \| `"unknown"` \| `"none"`
@@ -4580,6 +5755,14 @@ iBeacon 距离等级。
4580
5755
 
4581
5756
  ***
4582
5757
 
5758
+ ### SelectedMessageFileType
5759
+
5760
+ > **SelectedMessageFileType**: `"video"` \| `"image"` \| `"file"`
5761
+
5762
+ 选择消息文件后返回的文件类型。
5763
+
5764
+ ***
5765
+
4583
5766
  ### SensorInterval
4584
5767
 
4585
5768
  > **SensorInterval**: `"game"` \| `"ui"` \| `"normal"`
@@ -4588,9 +5771,19 @@ iBeacon 距离等级。
4588
5771
 
4589
5772
  ***
4590
5773
 
4591
- ### UpdateModelContextBlock
5774
+ ### UserCaptureScreenListener()
4592
5775
 
4593
- > **UpdateModelContextBlock**: [`UpdateModelContextSummaryBlock`](doubao-apps-sdk-open-api.md#updatemodelcontextsummaryblock) \| [`UpdateModelContextEntityBlock`](doubao-apps-sdk-open-api.md#updatemodelcontextentityblock)
5776
+ > **UserCaptureScreenListener**: (`event`) => `void`
5777
+
5778
+ 用户主动截屏事件监听函数。
5779
+
5780
+ #### Parameters
5781
+
5782
+ • **event**: [`UserCaptureScreenEvent`](doubao-apps-sdk-open-api.md#usercapturescreenevent)
5783
+
5784
+ #### Returns
5785
+
5786
+ `void`
4594
5787
 
4595
5788
  ***
4596
5789
 
@@ -4599,3 +5792,35 @@ iBeacon 距离等级。
4599
5792
  > **VibrateShortType**: `"heavy"` \| `"medium"` \| `"light"`
4600
5793
 
4601
5794
  短震动类型。
5795
+
5796
+ ## Variables
5797
+
5798
+ ### LoginType
5799
+
5800
+ > **LoginType**: `object`
5801
+
5802
+ #### Type declaration
5803
+
5804
+ ##### Login
5805
+
5806
+ > **Login**: `number` = `1`
5807
+
5808
+ 仅登录
5809
+
5810
+ ##### LoginThenPrivacy
5811
+
5812
+ > **LoginThenPrivacy**: `number` = `2`
5813
+
5814
+ 先登录再隐私协议,两次弹窗
5815
+
5816
+ ##### LoginWithPrivacy
5817
+
5818
+ > **LoginWithPrivacy**: `number` = `3`
5819
+
5820
+ 登录和隐私协议合并,一次弹窗
5821
+
5822
+ ##### Privacy
5823
+
5824
+ > **Privacy**: `number` = `0`
5825
+
5826
+ 隐私协议登录