@doubao-apps/create 0.0.29-rc.0 → 0.0.30

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 (69) hide show
  1. package/dist/template-empty/package.json +2 -2
  2. package/dist/template-empty/references/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +118 -2535
  3. package/dist/template-empty/references/reference/open-api/02-/345/256/232/344/275/215.md +135 -0
  4. package/dist/template-empty/references/reference/open-api/03-/345/255/230/345/202/250.md +409 -0
  5. package/dist/template-empty/references/reference/open-api/04-/350/267/257/347/224/261.md +165 -0
  6. package/dist/template-empty/references/reference/open-api/05-/347/225/214/351/235/242-/344/272/244/344/272/222.md +432 -0
  7. package/dist/template-empty/references/reference/open-api/07-/347/275/221/347/273/234.md +468 -0
  8. package/dist/template-empty/references/reference/open-api/08-/345/252/222/344/275/223.md +346 -0
  9. package/dist/template-empty/references/reference/open-api/09-/345/274/200/346/224/276/350/203/275/345/212/233-/344/270/232/345/212/241/350/203/275/345/212/233.md +929 -0
  10. package/dist/{template-starter/references/reference/open-api/04- → template-empty/references/reference/open-api/10-}/346/225/260/346/215/256/345/210/206/346/236/220.md +1 -1
  11. package/dist/template-empty/references/reference/open-api/README.md +30 -24
  12. package/dist/template-empty/references/reference/open-api.md +464 -0
  13. package/dist/template-starter/package.json +2 -2
  14. package/dist/template-starter/references/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +118 -2535
  15. package/dist/template-starter/references/reference/open-api/02-/345/256/232/344/275/215.md +135 -0
  16. package/dist/template-starter/references/reference/open-api/03-/345/255/230/345/202/250.md +409 -0
  17. package/dist/template-starter/references/reference/open-api/04-/350/267/257/347/224/261.md +165 -0
  18. package/dist/template-starter/references/reference/open-api/05-/347/225/214/351/235/242-/344/272/244/344/272/222.md +432 -0
  19. package/dist/template-starter/references/reference/open-api/07-/347/275/221/347/273/234.md +468 -0
  20. package/dist/template-starter/references/reference/open-api/08-/345/252/222/344/275/223.md +346 -0
  21. package/dist/template-starter/references/reference/open-api/09-/345/274/200/346/224/276/350/203/275/345/212/233-/344/270/232/345/212/241/350/203/275/345/212/233.md +929 -0
  22. package/dist/{template-empty/references/reference/open-api/04- → template-starter/references/reference/open-api/10-}/346/225/260/346/215/256/345/210/206/346/236/220.md +1 -1
  23. package/dist/template-starter/references/reference/open-api/README.md +30 -24
  24. package/dist/template-starter/references/reference/open-api.md +464 -0
  25. package/package.json +1 -1
  26. package/dist/template-empty/references/reference/open-api/02-/350/267/257/347/224/261.md +0 -63
  27. package/dist/template-starter/references/reference/open-api/02-/350/267/257/347/224/261.md +0 -63
  28. /package/dist/template-empty/references/reference/open-api/{03- → 06-}/347/225/214/351/235/242-/350/276/223/345/205/245.md" +0 -0
  29. /package/dist/template-empty/references/reference/open-api/{05- → 11-}/350/256/276/345/244/207-/350/223/235/347/211/231.md" +0 -0
  30. /package/dist/template-empty/references/reference/open-api/{06- → 12-}/350/256/276/345/244/207-wi-fi.md" +0 -0
  31. /package/dist/template-empty/references/reference/open-api/{07- → 13-}/350/256/276/345/244/207-/345/212/240/351/200/237/345/272/246/350/256/241.md" +0 -0
  32. /package/dist/template-empty/references/reference/open-api/{08- → 14-}/350/256/276/345/244/207-ibeacon.md" +0 -0
  33. /package/dist/template-empty/references/reference/open-api/{09- → 15-}/350/256/276/345/244/207-/347/275/227/347/233/230.md" +0 -0
  34. /package/dist/template-empty/references/reference/open-api/{10- → 16-}/350/256/276/345/244/207-/350/256/276/345/244/207/346/226/271/345/220/221.md" +0 -0
  35. /package/dist/template-empty/references/reference/open-api/{11- → 17-}/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md" +0 -0
  36. /package/dist/template-empty/references/reference/open-api/{12-ui- → 18-ui-}/350/276/223/345/205/245.md" +0 -0
  37. /package/dist/template-empty/references/reference/open-api/{13- → 19-}/350/256/276/345/244/207-/347/275/221/347/273/234.md" +0 -0
  38. /package/dist/template-empty/references/reference/open-api/{14- → 20-}/350/256/276/345/244/207-/347/237/255/344/277/241.md" +0 -0
  39. /package/dist/template-empty/references/reference/open-api/{15- → 21-}/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md" +0 -0
  40. /package/dist/template-empty/references/reference/open-api/{16- → 22-}/350/256/276/345/244/207-/347/224/265/346/261/240.md" +0 -0
  41. /package/dist/template-empty/references/reference/open-api/{17- → 23-}/350/256/276/345/244/207-/346/227/245/345/216/206.md" +0 -0
  42. /package/dist/template-empty/references/reference/open-api/{18- → 24-}/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md" +0 -0
  43. /package/dist/template-empty/references/reference/open-api/{19- → 25-}/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md" +0 -0
  44. /package/dist/template-empty/references/reference/open-api/{20- → 26-}/350/256/276/345/244/207-/345/212/240/345/257/206.md" +0 -0
  45. /package/dist/template-empty/references/reference/open-api/{21- → 27-}/350/256/276/345/244/207-/347/224/265/350/257/235.md" +0 -0
  46. /package/dist/template-empty/references/reference/open-api/{22- → 28-}/350/256/276/345/244/207-/346/211/253/347/240/201.md" +0 -0
  47. /package/dist/template-empty/references/reference/open-api/{23- → 29-}/350/256/276/345/244/207-/345/261/217/345/271/225.md" +0 -0
  48. /package/dist/template-empty/references/reference/open-api/{24- → 30-}/350/256/276/345/244/207-/351/234/207/345/212/250.md" +0 -0
  49. /package/dist/template-starter/references/reference/open-api/{03- → 06-}/347/225/214/351/235/242-/350/276/223/345/205/245.md" +0 -0
  50. /package/dist/template-starter/references/reference/open-api/{05- → 11-}/350/256/276/345/244/207-/350/223/235/347/211/231.md" +0 -0
  51. /package/dist/template-starter/references/reference/open-api/{06- → 12-}/350/256/276/345/244/207-wi-fi.md" +0 -0
  52. /package/dist/template-starter/references/reference/open-api/{07- → 13-}/350/256/276/345/244/207-/345/212/240/351/200/237/345/272/246/350/256/241.md" +0 -0
  53. /package/dist/template-starter/references/reference/open-api/{08- → 14-}/350/256/276/345/244/207-ibeacon.md" +0 -0
  54. /package/dist/template-starter/references/reference/open-api/{09- → 15-}/350/256/276/345/244/207-/347/275/227/347/233/230.md" +0 -0
  55. /package/dist/template-starter/references/reference/open-api/{10- → 16-}/350/256/276/345/244/207-/350/256/276/345/244/207/346/226/271/345/220/221.md" +0 -0
  56. /package/dist/template-starter/references/reference/open-api/{11- → 17-}/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md" +0 -0
  57. /package/dist/template-starter/references/reference/open-api/{12-ui- → 18-ui-}/350/276/223/345/205/245.md" +0 -0
  58. /package/dist/template-starter/references/reference/open-api/{13- → 19-}/350/256/276/345/244/207-/347/275/221/347/273/234.md" +0 -0
  59. /package/dist/template-starter/references/reference/open-api/{14- → 20-}/350/256/276/345/244/207-/347/237/255/344/277/241.md" +0 -0
  60. /package/dist/template-starter/references/reference/open-api/{15- → 21-}/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md" +0 -0
  61. /package/dist/template-starter/references/reference/open-api/{16- → 22-}/350/256/276/345/244/207-/347/224/265/346/261/240.md" +0 -0
  62. /package/dist/template-starter/references/reference/open-api/{17- → 23-}/350/256/276/345/244/207-/346/227/245/345/216/206.md" +0 -0
  63. /package/dist/template-starter/references/reference/open-api/{18- → 24-}/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md" +0 -0
  64. /package/dist/template-starter/references/reference/open-api/{19- → 25-}/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md" +0 -0
  65. /package/dist/template-starter/references/reference/open-api/{20- → 26-}/350/256/276/345/244/207-/345/212/240/345/257/206.md" +0 -0
  66. /package/dist/template-starter/references/reference/open-api/{21- → 27-}/350/256/276/345/244/207-/347/224/265/350/257/235.md" +0 -0
  67. /package/dist/template-starter/references/reference/open-api/{22- → 28-}/350/256/276/345/244/207-/346/211/253/347/240/201.md" +0 -0
  68. /package/dist/template-starter/references/reference/open-api/{23- → 29-}/350/256/276/345/244/207-/345/261/217/345/271/225.md" +0 -0
  69. /package/dist/template-starter/references/reference/open-api/{24- → 30-}/350/256/276/345/244/207-/351/234/207/345/212/250.md" +0 -0
@@ -1,6 +1,6 @@
1
1
  # Open API: 基础 / 账号 / 系统
2
2
 
3
- 账号、授权、宿主基础信息、窗口信息和定位。
3
+ 账号、授权、宿主基础信息、窗口信息和能力可用性。
4
4
 
5
5
  [返回目录](./README.md) | [返回速查](../open-api.md)
6
6
 
@@ -12,54 +12,6 @@
12
12
  | [getAccountInfoSync](#getaccountinfosync) | 同步获取账号信息。<br><br>同步 API。 |
13
13
  | [authorize](#authorize) | 初始化授权。<br><br>按 scope 申请授权。 |
14
14
  | [canIUse](#caniuse) | 检测当前宿主是否支持指定 API 或能力。<br><br>用于兼容性判断。 |
15
- | [getLocation](#getlocation) | 获取设备当前的地理位置信息。<br><br>可能涉及定位授权。 |
16
- | [showModal](#showmodal) | 显示模态对话框。 |
17
- | [showLoading](#showloading) | 显示 loading 提示框。<br><br>需调用 hideLoading 关闭。 |
18
- | [hideToast](#hidetoast) | 隐藏当前 Toast。 |
19
- | [hideLoading](#hideloading) | 隐藏当前 loading。 |
20
- | [showActionSheet](#showactionsheet) | 显示操作菜单。 |
21
- | [getMenuButtonBoundingClientRect](#getmenubuttonboundingclientrect) | 获取菜单按钮的布局位置信息。 |
22
- | [enableAlertBeforeUnload](#enablealertbeforeunload) | 开启页面返回前提醒。<br><br>配合 disableAlertBeforeUnload 使用。 |
23
- | [disableAlertBeforeUnload](#disablealertbeforeunload) | 关闭页面返回前提醒。 |
24
- | [showToast](#showtoast) | 显示 Toast 提示。<br><br>duration 和 icon 可控制提示表现。 |
25
- | [dispatchActionDirective](#dispatchactiondirective) | 描述用户行为,约束模型行为并指定后续执行路径。<br><br>适用于卡片交互后向模型补充结构化动作上下文,例如按钮点击、选项选择或表单提交。 |
26
- | [expiredWidget](#expiredwidget) | 更新过期的 widget 为固定卡片。 |
27
- | [loginWithDoubaoWidget](#loginwithdoubaowidget) | 发起豆包 Widget 登录。 |
28
- | [login](#login) | 发起登录并获取登录凭证。 |
29
- | [postLoginResult](#postloginresult) | 回传 MCP 授权登录凭证。 |
30
- | [createSignOrder](#createsignorder) | 创建签约订单。 |
31
- | [getOrderPaymentWithSign](#getorderpaymentwithsign) | 使用签名信息拉起收银台完成订单支付。 |
32
- | [getOrderPayment](#getorderpayment) | 拉起收银台完成订单支付。 |
33
- | [requestCombineOrder](#requestcombineorder) | 请求创建合单订单。 |
34
- | [requestOrder](#requestorder) | 发起订单支付流程。 |
35
- | [sign](#sign) | 拉起签约流程。 |
36
- | [getPrivacySetting](#getprivacysetting) | 获取隐私设置状态。 |
37
- | [sendQueryMessage](#sendquerymessage) | 以用户身份发送一条消息。<br><br>返回 void,不是 Promise。 |
38
- | [setAdditionalContext](#setadditionalcontext) | 设置全局上下文供大模型理解。<br><br>设置全局上下文。 |
39
- | [updateModelContext](#updatemodelcontext) | 向 Agent 捐赠上下文。 |
40
- | [updateWidget](#updatewidget) | 更新指定卡片。 |
41
- | [saveImageToPhotosAlbum](#saveimagetophotosalbum) | 保存图片到系统相册。 |
42
- | [previewImage](#previewimage) | 预览图片。 |
43
- | [getImageInfo](#getimageinfo) | 获取图片信息。 |
44
- | [chooseImage](#chooseimage) | 选择图片。 |
45
- | [compressImage](#compressimage) | 压缩图片。 |
46
- | [request](#request) | 发起网络请求。<br><br>返回 statusCode、header 和 data。 |
47
- | [openApp](#openapp) | 通过 deep link 等方式打开外部应用。 |
48
- | [navigateTo](#navigateto) | 保留当前页面,跳转到应用内的某个页面。 |
49
- | [redirectTo](#redirectto) | 关闭当前页面,跳转到应用内的某个页面。 |
50
- | [reLaunch](#relaunch) | 关闭所有页面并跳转到应用内页面。 |
51
- | [navigateBack](#navigateback) | 关闭当前页面,返回上一页面或多级页面。 |
52
- | [exitApp](#exitapp) | 退出当前所有页面。<br><br>会退出当前所有页面。 |
53
- | [setStorage](#setstorage) | 将数据写入本地缓存。 |
54
- | [setStorageSync](#setstoragesync) | 将数据写入本地缓存。<br><br>同步 API。 |
55
- | [getStorage](#getstorage) | 从本地缓存读取数据。 |
56
- | [getStorageSync](#getstoragesync) | 从本地缓存同步读取数据。<br><br>同步 API。 |
57
- | [removeStorage](#removestorage) | 删除本地缓存中指定 key 的数据。 |
58
- | [removeStorageSync](#removestoragesync) | 删除本地缓存中指定 key 的数据。<br><br>同步 API。 |
59
- | [clearStorage](#clearstorage) | 清空本地缓存。 |
60
- | [clearStorageSync](#clearstoragesync) | 清空本地缓存。<br><br>同步 API。 |
61
- | [getStorageInfo](#getstorageinfo) | 获取本地缓存信息。 |
62
- | [getStorageInfoSync](#getstorageinfosync) | 同步获取本地缓存信息。<br><br>同步 API。 |
63
15
  | [getWindowInfoSync](#getwindowinfosync) | 获取窗口信息。<br><br>同步 API。 |
64
16
  | [getSystemSetting](#getsystemsetting) | 获取设备设置。 |
65
17
  | [getAppBaseInfoSync](#getappbaseinfosync) | 获取应用基础信息。<br><br>同步 API。 |
@@ -158,2618 +110,249 @@ Promise 对象,授权成功时会返回授权结果
158
110
 
159
111
  用于兼容性判断。
160
112
 
161
- <a id="getlocation"></a>
162
- ### getLocation()
113
+ <a id="getwindowinfosync"></a>
114
+ ### getWindowInfoSync()
163
115
 
164
- > **getLocation**(`params`?): `Promise`\<[`GetLocationResponse`](#getlocationresponse)\>
116
+ > **getWindowInfoSync**(`_param`?): [`GetWindowInfoResult`](#getwindowinforesult)
165
117
 
166
- 获取设备当前的地理位置信息。
118
+ 获取窗口信息。
167
119
 
168
120
  #### Parameters
169
121
 
170
- **params?**: [`GetLocationParams`](#getlocationparams)
122
+ **\_param?**
171
123
 
172
124
  #### Returns
173
125
 
174
- `Promise`\<[`GetLocationResponse`](#getlocationresponse)\>
175
-
176
- 返回一个 Promise,成功时解析为包含地理位置信息的对象,包含:
177
- - `latitude`: number - 纬度。
178
- - `longitude`: number - 经度。
179
- - `timestamp`: string - 时间戳。
180
- - `speed`: number - 行进速度,单位:米/秒。
181
- - `accuracy`: number - 定位精度,单位:米。
182
- 参考 [GetLocationResponse](#getlocationresponse)。
183
-
184
- #### Throws
185
-
186
- 如果调用失败(例如,用户拒绝权限、定位服务关闭等),则抛出此错误。
187
-
188
- #### Remarks
126
+ [`GetWindowInfoResult`](#getwindowinforesult)
189
127
 
190
- 可能涉及定位授权。
128
+ 返回窗口尺寸、状态栏高度和安全区域等信息,字段见 [GetWindowInfoResult](#getwindowinforesult)。
191
129
 
192
130
  #### Example
193
131
 
194
132
  ```typescript
195
- import { getLocation } from '@doubao-apps/framework';
196
-
197
- async function fetchLocation() {
198
- try {
199
- const locationData = await getLocation();
200
- console.log('纬度:', locationData.latitude);
201
- console.log('经度:', locationData.longitude);
202
- console.log('时间戳:', locationData.timestamp);
203
- console.log('行进速度:', locationData.speed);
204
- console.log('定位精度:', locationData.accuracy);
205
- } catch (error) {
206
- console.error('获取位置失败:', error);
207
- // 处理错误,例如提示用户开启定位权限
208
- }
209
- }
210
-
211
- fetchLocation();
212
- ```
213
-
214
- <a id="showmodal"></a>
215
- ### showModal()
216
-
217
- > **showModal**(`params`): `Promise`\<[`ShowModalResult`](#showmodalresult)\>
218
-
219
- 显示模态对话框。
220
-
221
- #### Parameters
222
-
223
- • **params**: [`ShowModalParams`](#showmodalparams)
224
-
225
- #### Returns
226
-
227
- `Promise`\<[`ShowModalResult`](#showmodalresult)\>
228
-
229
- #### Example
230
-
231
- ```ts
232
- import { showModal } from '@doubao-apps/framework/api';
133
+ import { getWindowInfoSync } from '@doubao-apps/framework/api';
233
134
 
234
- const result = await showModal({
235
- title: '提示',
236
- content: '确认删除这条记录吗?',
237
- confirmText: '删除',
238
- cancelText: '取消'
239
- });
135
+ const result = getWindowInfoSync();
240
136
 
241
- if (result.action === 'confirm') {
242
- console.log('用户确认删除');
243
- }
137
+ console.log(result.windowWidth, result.windowHeight);
138
+ console.log(result.safeArea?.top, result.screenTop);
244
139
  ```
245
140
 
246
- <a id="showloading"></a>
247
- ### showLoading()
248
-
249
- > **showLoading**(`params`?): `Promise`\<`object`\>
250
-
251
- 显示 loading 提示框。
252
-
253
- #### Parameters
254
-
255
- • **params?**: [`ShowLoadingParams`](#showloadingparams)
256
-
257
- #### Returns
258
-
259
- `Promise`\<`object`\>
260
-
261
- #### Remarks
262
-
263
- 需调用 hideLoading 关闭。
264
-
265
- <a id="hidetoast"></a>
266
- ### hideToast()
267
-
268
- > **hideToast**(`params`?): `Promise`\<`object`\>
269
-
270
- 隐藏当前 Toast。
271
-
272
- #### Parameters
273
-
274
- • **params?**: [`HideInteractionParams`](#hideinteractionparams)
275
-
276
- #### Returns
277
-
278
- `Promise`\<`object`\>
279
-
280
- <a id="hideloading"></a>
281
- ### hideLoading()
141
+ <a id="getsystemsetting"></a>
142
+ ### getSystemSetting()
282
143
 
283
- > **hideLoading**(`params`?): `Promise`\<`object`\>
144
+ > **getSystemSetting**(`params`?): [`GetSystemSettingResult`](#getsystemsettingresult)
284
145
 
285
- 隐藏当前 loading。
146
+ 获取设备设置。
286
147
 
287
148
  #### Parameters
288
149
 
289
- • **params?**: [`HideInteractionParams`](#hideinteractionparams)
150
+ • **params?**
290
151
 
291
152
  #### Returns
292
153
 
293
- `Promise`\<`object`\>
294
-
295
- <a id="showactionsheet"></a>
296
- ### showActionSheet()
297
-
298
- > **showActionSheet**(`params`): `Promise`\<[`ShowActionSheetResult`](#showactionsheetresult)\>
299
-
300
- 显示操作菜单。
301
-
302
- #### Parameters
303
-
304
- • **params**: [`ShowActionSheetParams`](#showactionsheetparams)
305
-
306
- #### Returns
154
+ [`GetSystemSettingResult`](#getsystemsettingresult)
307
155
 
308
- `Promise`\<[`ShowActionSheetResult`](#showactionsheetresult)\>
156
+ 返回蓝牙、定位、Wi-Fi 系统开关和设备方向等字段,见 [GetSystemSettingResult](#getsystemsettingresult)
309
157
 
310
158
  #### Example
311
159
 
312
- ```ts
313
- import { showActionSheet } from '@doubao-apps/framework/api';
160
+ ```typescript
161
+ import { getSystemSetting } from '@doubao-apps/framework/api';
314
162
 
315
- const result = await showActionSheet({
316
- itemList: ['编辑', '删除']
317
- });
163
+ const result = getSystemSetting();
318
164
 
319
- console.log(result.tapIndex);
165
+ console.log(result.bluetoothEnabled, result.locationEnabled);
166
+ console.log(result.wifiEnabled, result.deviceOrientation);
320
167
  ```
321
168
 
322
- <a id="getmenubuttonboundingclientrect"></a>
323
- ### getMenuButtonBoundingClientRect()
169
+ <a id="getappbaseinfosync"></a>
170
+ ### getAppBaseInfoSync()
324
171
 
325
- > **getMenuButtonBoundingClientRect**(`params`?): [`MenuButtonBoundingClientRect`](#menubuttonboundingclientrect)
172
+ > **getAppBaseInfoSync**(`_params`?): [`GetAppBaseInfoResult`](#getappbaseinforesult)
326
173
 
327
- 获取菜单按钮的布局位置信息。
174
+ 获取应用基础信息。
328
175
 
329
176
  #### Parameters
330
177
 
331
- **params?**
178
+ **\_params?**
332
179
 
333
180
  #### Returns
334
181
 
335
- [`MenuButtonBoundingClientRect`](#menubuttonboundingclientrect)
182
+ [`GetAppBaseInfoResult`](#getappbaseinforesult)
336
183
 
337
- 返回菜单按钮相对屏幕左上角的坐标和尺寸,字段见 [MenuButtonBoundingClientRect](#menubuttonboundingclientrect)。
184
+ 返回 SDK 版本、调试开关、宿主信息、语言和主题等字段,见 [GetAppBaseInfoResult](#getappbaseinforesult)。
338
185
 
339
186
  #### Example
340
187
 
341
- ```ts
342
- import { getMenuButtonBoundingClientRect } from '@doubao-apps/framework/api';
188
+ ```typescript
189
+ import { getAppBaseInfoSync } from '@doubao-apps/framework/api';
343
190
 
344
- const rect = getMenuButtonBoundingClientRect();
191
+ const result = getAppBaseInfoSync();
345
192
 
346
- console.log(rect.width, rect.height);
347
- console.log(rect.top, rect.right, rect.bottom, rect.left);
193
+ console.log(result.language, result.SDKVersion, result.theme);
194
+ console.log(result.host?.appId, result.enableDebug);
348
195
  ```
349
196
 
350
- <a id="enablealertbeforeunload"></a>
351
- ### enableAlertBeforeUnload()
352
-
353
- > **enableAlertBeforeUnload**(`params`): `Promise`\<`object`\>
354
-
355
- 开启页面返回前提醒。
356
- 当用户在小程序非最底层页面点击左上角返回按钮、左上角首页按钮或 Android 系统 back 键时,弹起询问弹窗
357
-
358
- 返回询问对话框只会对调用的当前页面生效,通过手势滑动返回时不会弹起询问对话框
359
-
360
- #### Parameters
361
-
362
- • **params**: [`EnableAlertBeforeUnloadParams`](#enablealertbeforeunloadparams)
363
-
364
- #### Returns
365
-
366
- `Promise`\<`object`\>
367
-
368
- #### Remarks
369
-
370
- 配合 disableAlertBeforeUnload 使用。
371
-
372
- <a id="disablealertbeforeunload"></a>
373
- ### disableAlertBeforeUnload()
374
-
375
- > **disableAlertBeforeUnload**(`params`?): `Promise`\<`object`\>
376
-
377
- 关闭页面返回前提醒。
378
-
379
- #### Parameters
380
-
381
- • **params?**: `Record`\<`string`, `never`\>
382
-
383
- #### Returns
384
-
385
- `Promise`\<`object`\>
386
-
387
- <a id="showtoast"></a>
388
- ### showToast()
389
-
390
- > **showToast**(`params`): `Promise`\<`object`\>
197
+ <a id="getwindowinfo"></a>
198
+ ### getWindowInfo()
391
199
 
392
- 显示 Toast 提示。
200
+ > **getWindowInfo**(`_params`?): `Promise`\<[`GetWindowInfoResult`](#getwindowinforesult)\>
393
201
 
394
- 参数 `options` 包含以下字段:
395
- - `message`: 提示的内容。
396
- - `type`: Toast 的类型,可选值为 'success' 或 'error'。
397
- - `duration`: 提示的延迟时间,单位毫秒,默认为 2000。
398
- - `icon`: 图标,可选值为 'success', 'error', 'warn'。
399
- - `customIcon`: 自定义图标的 URL 或 base64 字符串。
202
+ 获取窗口信息。
400
203
 
401
204
  #### Parameters
402
205
 
403
- **params**: [`ShowToastParams`](#showtoastparams)
206
+ **\_params?**
404
207
 
405
208
  #### Returns
406
209
 
407
- `Promise`\<`object`\>
408
-
409
- 返回一个 Promise,在 Toast 显示结束时 resolve。
410
-
411
- #### Remarks
210
+ `Promise`\<[`GetWindowInfoResult`](#getwindowinforesult)\>
412
211
 
413
- duration 和 icon 可控制提示表现。
212
+ 返回窗口尺寸、状态栏高度和安全区域等信息,字段见 [GetWindowInfoResult](#getwindowinforesult)。
414
213
 
415
214
  #### Example
416
215
 
417
216
  ```typescript
418
- import { showToast } from '@doubao-apps/framework';
419
-
420
- // 显示一个成功的 Toast
421
- showToast({
422
- message: '操作成功',
423
- type: 'success',
424
- icon: 'success',
425
- duration: 1500
426
- }).then(() => {
427
- console.log('Toast 显示完毕');
428
- });
429
-
430
- // 显示一个错误的 Toast
431
- showToast({
432
- message: '网络错误',
433
- type: 'error',
434
- icon: 'error'
435
- });
436
- ```
437
-
438
- <a id="dispatchactiondirective"></a>
439
- ### dispatchActionDirective()
440
-
441
- > **dispatchActionDirective**(`params`): `Promise`\<`object`\>
442
-
443
- 描述用户行为,约束模型行为并指定后续执行路径。
444
-
445
- #### Parameters
446
-
447
- • **params**: [`DispatchActionDirectiveParams`](#dispatchactiondirectiveparams)
448
-
449
- 动作描述、预期行为及工具调用约束参数。
450
-
451
- #### Returns
452
-
453
- `Promise`\<`object`\>
454
-
455
- 返回一个 Promise,在动作指令成功下发时解析。
456
-
457
- #### Remarks
458
-
459
- 适用于卡片交互后向模型补充结构化动作上下文,例如按钮点击、选项选择或表单提交。
460
-
461
- <a id="expiredwidget"></a>
462
- ### expiredWidget()
463
-
464
- > **expiredWidget**(`__namedParameters`): `Promise`\<`object`\>
465
-
466
- 更新过期的 widget 为固定卡片
467
-
468
- #### Parameters
469
-
470
- • **\_\_namedParameters**: [`ExpiredWidgetParams`](#expiredwidgetparams)
471
-
472
- #### Returns
473
-
474
- `Promise`\<`object`\>
475
-
476
- #### Description
477
-
478
- 用于将状态已经过期的 widget 实例转换为固定的卡片
217
+ import { getWindowInfo } from '@doubao-apps/framework/api';
479
218
 
480
- #### Example
219
+ const result = await getWindowInfo();
481
220
 
482
- ```ts
483
- expiredWidget({
484
- widgetInstanceId: 'instance_123',
485
- url: '${pageId}?key=value'
486
- });
221
+ console.log(result.windowWidth, result.windowHeight);
222
+ console.log(result.safeArea?.top, result.screenTop);
487
223
  ```
488
224
 
489
- <a id="loginwithdoubaowidget"></a>
490
- ### loginWithDoubaoWidget()
491
-
492
- > **loginWithDoubaoWidget**(`params`): `Promise`\<[`LoginWithWidgetResult`](#loginwithwidgetresult)\>
493
-
494
- 发起豆包 Widget 登录。
495
-
496
- #### Parameters
497
-
498
- • **params**: [`LoginWithWidgetRequest`](#loginwithwidgetrequest)
499
-
500
- Widget 登录参数。
501
-
502
- #### Returns
503
-
504
- `Promise`\<[`LoginWithWidgetResult`](#loginwithwidgetresult)\>
505
-
506
- 返回登录结果。
507
-
508
- <a id="login"></a>
509
- ### login()
225
+ <a id="getappbaseinfo"></a>
226
+ ### getAppBaseInfo()
510
227
 
511
- > **login**(`params`?): `Promise`\<[`LoginResult`](#loginresult)\>
228
+ > **getAppBaseInfo**(`params`?): `Promise`\<[`GetAppBaseInfoResult`](#getappbaseinforesult)\>
512
229
 
513
- 发起登录并获取登录凭证。
230
+ 获取应用基础信息。
514
231
 
515
232
  #### Parameters
516
233
 
517
- • **params?**: [`LoginRequest`](#loginrequest)
518
-
519
- 登录参数。
234
+ • **params?**
520
235
 
521
236
  #### Returns
522
237
 
523
- `Promise`\<[`LoginResult`](#loginresult)\>
524
-
525
- 返回包含登录凭证 code 的 Promise。
526
-
527
- <a id="postloginresult"></a>
528
- ### postLoginResult()
529
-
530
- > **postLoginResult**(`params`): `Promise`\<`object`\>
531
-
532
- 回传 MCP 授权登录凭证。
533
-
534
- #### Parameters
535
-
536
- • **params**: [`PostLoginResultRequest`](#postloginresultrequest)
238
+ `Promise`\<[`GetAppBaseInfoResult`](#getappbaseinforesult)\>
537
239
 
538
- 登录结果回传参数。
240
+ 返回 SDK 版本、调试开关、宿主信息、语言和主题等字段,见 [GetAppBaseInfoResult](#getappbaseinforesult)。
539
241
 
540
- #### Returns
242
+ #### Example
541
243
 
542
- `Promise`\<`object`\>
244
+ ```typescript
245
+ import { getAppBaseInfo } from '@doubao-apps/framework/api';
543
246
 
544
- 返回回传完成的 Promise。
247
+ const result = await getAppBaseInfo();
545
248
 
546
- <a id="createsignorder"></a>
547
- ### createSignOrder()
249
+ console.log(result.language, result.SDKVersion, result.theme);
250
+ console.log(result.host?.appId, result.enableDebug);
251
+ ```
548
252
 
549
- > **createSignOrder**(`params`): `Promise`\<[`CreateSignOrderResult`](#createsignorderresult)\>
253
+ ## 相关类型
550
254
 
551
- 创建签约订单。
255
+ <a id="getaccountinforesult"></a>
256
+ ### GetAccountInfoResult
552
257
 
553
- #### Parameters
258
+ 获取当前账号信息。
554
259
 
555
- **params**: [`CreateSignOrderParams`](#createsignorderparams)
260
+ #### Properties
556
261
 
557
- 签约订单参数
262
+ ##### miniProgram
558
263
 
559
- #### Returns
264
+ > **miniProgram**: [`DoubaoAppAccountInfo`](#doubaoappaccountinfo)
560
265
 
561
- `Promise`\<[`CreateSignOrderResult`](#createsignorderresult)\>
266
+ 豆包 App账号信息
562
267
 
563
- 返回一个 Promise,解析为签约订单结果。
268
+ ##### plugin?
564
269
 
565
- <a id="getorderpaymentwithsign"></a>
566
- ### getOrderPaymentWithSign()
270
+ > `optional` **plugin**: [`PluginAccountInfo`](#pluginaccountinfo)
567
271
 
568
- > **getOrderPaymentWithSign**(`params`): `Promise`\<[`GetOrderPaymentResult`](#getorderpaymentresult)\>
272
+ 插件账号信息(仅在插件中调用时包含)
569
273
 
570
- 使用签名信息拉起收银台完成订单支付。
274
+ <a id="doubaoappaccountinfo"></a>
275
+ ### DoubaoAppAccountInfo
571
276
 
572
- #### Parameters
277
+ 豆包 App 账号信息。
573
278
 
574
- **params**: [`GetOrderPaymentWithSignParams`](#getorderpaymentwithsignparams)
279
+ #### Properties
575
280
 
576
- 签名支付参数
281
+ ##### appId
577
282
 
578
- #### Returns
283
+ > **appId**: `string`
579
284
 
580
- `Promise`\<[`GetOrderPaymentResult`](#getorderpaymentresult)\>
285
+ 豆包 App appId
581
286
 
582
- 返回一个 Promise,成功时解析为订单支付结果。
287
+ ##### envVersion
583
288
 
584
- <a id="getorderpayment"></a>
585
- ### getOrderPayment()
289
+ > **envVersion**: `"develop"` \| `"trial"` \| `"release"`
586
290
 
587
- > **getOrderPayment**(`params`): `Promise`\<[`GetOrderPaymentResult`](#getorderpaymentresult)\>
291
+ 豆包 App 运行环境。
588
292
 
589
- 拉起收银台完成订单支付。
293
+ - develop: 开发版
294
+ - trial: 体验版
295
+ - release: 正式版
590
296
 
591
- #### Parameters
297
+ ##### version
592
298
 
593
- **params**: [`GetOrderPaymentParams`](#getorderpaymentparams)
299
+ > **version**: `string`
594
300
 
595
- 支付参数
301
+ 线上豆包 App 版本号。
596
302
 
597
- #### Returns
303
+ <a id="pluginaccountinfo"></a>
304
+ ### PluginAccountInfo
598
305
 
599
- `Promise`\<[`GetOrderPaymentResult`](#getorderpaymentresult)\>
306
+ 插件账号信息(仅在插件中调用时包含)。
600
307
 
601
- 返回一个 Promise,成功时解析为订单支付结果。
308
+ #### Properties
602
309
 
603
- <a id="requestcombineorder"></a>
604
- ### requestCombineOrder()
310
+ ##### appId
605
311
 
606
- > **requestCombineOrder**(`params`): `Promise`\<[`RequestCombineOrderResult`](#requestcombineorderresult)\>
312
+ > **appId**: `string`
607
313
 
608
- 请求创建合单订单。
314
+ 插件 appId
609
315
 
610
- #### Parameters
316
+ ##### version
611
317
 
612
- **params**: [`RequestCombineOrderParams`](#requestcombineorderparams)
318
+ > **version**: `string`
613
319
 
614
- 合单订单参数
320
+ 插件版本号,'a.b.c' 形式
615
321
 
616
- #### Returns
322
+ <a id="authorizerequest"></a>
323
+ ### AuthorizeRequest
617
324
 
618
- `Promise`\<[`RequestCombineOrderResult`](#requestcombineorderresult)\>
325
+ #### Properties
619
326
 
620
- 返回一个 Promise,解析为合单订单结果。
327
+ ##### scope
621
328
 
622
- <a id="requestorder"></a>
623
- ### requestOrder()
329
+ > **scope**: [`Scope`](#scope-1)
624
330
 
625
- > **requestOrder**(`params`): `Promise`\<[`RequestOrderResult`](#requestorderresult)\>
331
+ 授权范围
626
332
 
627
- 发起订单支付流程。
333
+ <a id="scope-1"></a>
334
+ <a id="scope"></a>
335
+ ### Scope
628
336
 
629
- #### Parameters
337
+ > **Scope**: `"scope.userLocation"` \| `"scope.userFuzzyLocation"` \| `"scope.userLocationBackground"` \| `"scope.payment"` \| `"scope.record"` \| `"scope.bluetooth"` \| `"scope.camera"` \| `"scope.addPhoneContact"` \| `"scope.addPhoneCalendar"`
630
338
 
631
- **params**: [`RequestOrderParams`](#requestorderparams)
339
+ <a id="caniuseparams"></a>
340
+ ### CanIUseParams
632
341
 
633
- 订单支付请求参数。
342
+ #### Properties
634
343
 
635
- #### Returns
344
+ ##### schema
636
345
 
637
- `Promise`\<[`RequestOrderResult`](#requestorderresult)\>
346
+ > **schema**: `string`
638
347
 
639
- 返回订单支付请求结果。
348
+ <a id="caniuseresult"></a>
349
+ ### CanIUseResult
640
350
 
641
- <a id="sign"></a>
642
- ### sign()
351
+ #### Properties
643
352
 
644
- > **sign**(`params`): `Promise`\<[`SignResult`](#signresult)\>
353
+ ##### result
645
354
 
646
- 拉起签约流程。
647
-
648
- #### Parameters
649
-
650
- • **params**: [`SignParams`](#signparams)
651
-
652
- 签约参数
653
-
654
- #### Returns
655
-
656
- `Promise`\<[`SignResult`](#signresult)\>
657
-
658
- 返回一个 Promise,解析为签约结果。
659
-
660
- <a id="getprivacysetting"></a>
661
- ### getPrivacySetting()
662
-
663
- > **getPrivacySetting**(`params`?): `Promise`\<[`PrivacySettingResult`](#privacysettingresult)\>
664
-
665
- 获取隐私设置状态。
666
-
667
- #### Parameters
668
-
669
- • **params?**
670
-
671
- #### Returns
672
-
673
- `Promise`\<[`PrivacySettingResult`](#privacysettingresult)\>
674
-
675
- 返回隐私设置状态。
676
-
677
- <a id="sendquerymessage"></a>
678
- ### sendQueryMessage()
679
-
680
- > **sendQueryMessage**(`params`): `void`
681
-
682
- 以用户身份发送一条消息
683
-
684
- 由于会自动获取页面上下文来确定向哪个 bot 发送消息,因此只能在卡片或页面中调用
685
-
686
- #### Parameters
687
-
688
- • **params**: [`SendQueryMessageParams`](#sendquerymessageparams)
689
-
690
- #### Returns
691
-
692
- `void`
693
-
694
- #### Example
695
-
696
- ```ts
697
- await sendQueryMessage({ content: '订阅消息', type: 'text' })
698
- ```
699
-
700
- <a id="setadditionalcontext"></a>
701
- ### setAdditionalContext()
702
-
703
- > **setAdditionalContext**(`params`): `Promise`\<`object`\>
704
-
705
- 设置全局上下文供大模型理解
706
-
707
- #### Parameters
708
-
709
- • **params**: [`SetAdditionalContextParams`](#setadditionalcontextparams)
710
-
711
- #### Returns
712
-
713
- `Promise`\<`object`\>
714
-
715
- #### Remarks
716
-
717
- 设置全局上下文。
718
-
719
- <a id="updatemodelcontext"></a>
720
- ### updateModelContext()
721
-
722
- > **updateModelContext**(`params`): `Promise`\<`object`\>
723
-
724
- 向 Agent 捐赠上下文
725
-
726
- #### Parameters
727
-
728
- • **params**: [`UpdateModelContextParams`](#updatemodelcontextparams)
729
-
730
- #### Returns
731
-
732
- `Promise`\<`object`\>
733
-
734
- <a id="updatewidget"></a>
735
- ### updateWidget()
736
-
737
- > **updateWidget**(`params`): `Promise`\<`object`\>
738
-
739
- 更新指定卡片
740
-
741
- #### Parameters
742
-
743
- • **params**: [`UpdateWidgetParams`](#updatewidgetparams)
744
-
745
- #### Returns
746
-
747
- `Promise`\<`object`\>
748
-
749
- <a id="saveimagetophotosalbum"></a>
750
- ### saveImageToPhotosAlbum()
751
-
752
- > **saveImageToPhotosAlbum**(`params`): `Promise`\<`object`\>
753
-
754
- 保存图片到系统相册。
755
-
756
- 需要先确保应用已具备写入系统相册的权限。
757
-
758
- #### Parameters
759
-
760
- • **params**: [`SaveImageToPhotosAlbumParams`](#saveimagetophotosalbumparams)
761
-
762
- #### Returns
763
-
764
- `Promise`\<`object`\>
765
-
766
- #### Example
767
-
768
- ```typescript
769
- import { saveImageToPhotosAlbum } from '@doubao-apps/framework/api';
770
-
771
- await saveImageToPhotosAlbum({
772
- filePath: '/path/to/image.png'
773
- });
774
- ```
775
-
776
- <a id="previewimage"></a>
777
- ### previewImage()
778
-
779
- > **previewImage**(`params`): `Promise`\<`object`\>
780
-
781
- 预览图片。
782
-
783
- #### Parameters
784
-
785
- • **params**: [`PreviewImageParams`](#previewimageparams)
786
-
787
- #### Returns
788
-
789
- `Promise`\<`object`\>
790
-
791
- <a id="getimageinfo"></a>
792
- ### getImageInfo()
793
-
794
- > **getImageInfo**(`params`): `Promise`\<[`GetImageInfoResult`](#getimageinforesult)\>
795
-
796
- 获取图片信息。
797
-
798
- #### Parameters
799
-
800
- • **params**: [`GetImageInfoParams`](#getimageinfoparams)
801
-
802
- #### Returns
803
-
804
- `Promise`\<[`GetImageInfoResult`](#getimageinforesult)\>
805
-
806
- <a id="chooseimage"></a>
807
- ### chooseImage()
808
-
809
- > **chooseImage**(`params`?): `Promise`\<[`ChooseImageResult`](#chooseimageresult)\>
810
-
811
- 选择图片。
812
-
813
- #### Parameters
814
-
815
- • **params?**: [`ChooseImageParams`](#chooseimageparams)
816
-
817
- #### Returns
818
-
819
- `Promise`\<[`ChooseImageResult`](#chooseimageresult)\>
820
-
821
- <a id="compressimage"></a>
822
- ### compressImage()
823
-
824
- > **compressImage**(`params`): `Promise`\<[`CompressImageResult`](#compressimageresult)\>
825
-
826
- 压缩图片。
827
-
828
- #### Parameters
829
-
830
- • **params**: [`CompressImageParams`](#compressimageparams)
831
-
832
- #### Returns
833
-
834
- `Promise`\<[`CompressImageResult`](#compressimageresult)\>
835
-
836
- <a id="request"></a>
837
- ### request()
838
-
839
- > **request**(`params`): `Promise`\<[`RequestResponse`](#requestresponse)\>
840
-
841
- 发起网络请求。
842
-
843
- #### Parameters
844
-
845
- • **params**: [`RequestParams`](#requestparams)
846
-
847
- 请求参数,字段见 [RequestParams](#requestparams)。
848
-
849
- #### Returns
850
-
851
- `Promise`\<[`RequestResponse`](#requestresponse)\>
852
-
853
- 返回一个 Promise,解析为 [RequestResponse](#requestresponse)。
854
-
855
- #### Remarks
856
-
857
- 返回 statusCode、header 和 data。
858
-
859
- #### Example
860
-
861
- ```typescript
862
- import { request } from '@doubao-apps/framework/api';
863
-
864
- const result = await request({
865
- url: 'https://postman-echo.com/post',
866
- method: 'POST',
867
- dataType: 'json',
868
- header: { 'content-type': 'application/json' },
869
- data: { hello: 'world' }
870
- });
871
-
872
- console.log(result.statusCode, result.data);
873
- ```
874
-
875
- <a id="openapp"></a>
876
- ### openApp()
877
-
878
- > **openApp**(`params`): `Promise`\<[`OpenAppResult`](#openappresult)\>
879
-
880
- 通过 deep link 等方式打开外部应用。
881
-
882
- #### Parameters
883
-
884
- • **params**: [`OpenAppRequest`](#openapprequest)
885
-
886
- 外部应用打开参数。
887
-
888
- #### Returns
889
-
890
- `Promise`\<[`OpenAppResult`](#openappresult)\>
891
-
892
- 返回外部应用打开结果。
893
-
894
- <a id="navigateto"></a>
895
- ### navigateTo()
896
-
897
- > **navigateTo**(`params`): `Promise`\<`object`\>
898
-
899
- 保留当前页面,跳转到应用内的某个页面。
900
-
901
- #### Parameters
902
-
903
- • **params**: [`NavigateToParams`](#navigatetoparams)
904
-
905
- #### Returns
906
-
907
- `Promise`\<`object`\>
908
-
909
- <a id="redirectto"></a>
910
- ### redirectTo()
911
-
912
- > **redirectTo**(`params`): `Promise`\<`object`\>
913
-
914
- 关闭当前页面,跳转到应用内的某个页面。
915
-
916
- #### Parameters
917
-
918
- • **params**: [`NavigateToParams`](#navigatetoparams)
919
-
920
- #### Returns
921
-
922
- `Promise`\<`object`\>
923
-
924
- <a id="relaunch"></a>
925
- ### reLaunch()
926
-
927
- > **reLaunch**(`params`): `Promise`\<`object`\>
928
-
929
- 关闭所有页面并跳转到应用内页面。
930
-
931
- #### Parameters
932
-
933
- • **params**: [`NavigateToParams`](#navigatetoparams)
934
-
935
- #### Returns
936
-
937
- `Promise`\<`object`\>
938
-
939
- <a id="navigateback"></a>
940
- ### navigateBack()
941
-
942
- > **navigateBack**(`params`?): `Promise`\<`object`\>
943
-
944
- 关闭当前页面,返回上一页面或多级页面。
945
-
946
- #### Parameters
947
-
948
- • **params?**: [`NavigateBackParams`](#navigatebackparams)
949
-
950
- #### Returns
951
-
952
- `Promise`\<`object`\>
953
-
954
- <a id="exitapp"></a>
955
- ### exitApp()
956
-
957
- > **exitApp**(): `Promise`\<`object`\>
958
-
959
- 退出当前所有页面。
960
-
961
- #### Returns
962
-
963
- `Promise`\<`object`\>
964
-
965
- #### Remarks
966
-
967
- 会退出当前所有页面。
968
-
969
- <a id="setstorage"></a>
970
- ### setStorage()
971
-
972
- > **setStorage**\<`TData`\>(`params`): `Promise`\<`object`\>
973
-
974
- 将数据写入本地缓存。
975
-
976
- #### Type parameters
977
-
978
- • **TData** = `unknown`
979
-
980
- #### Parameters
981
-
982
- • **params**: [`SetStorageParams`](#setstorageparamstdata)\<`TData`\>
983
-
984
- 存储参数,字段见 [SetStorageParams](#setstorageparamstdata)。
985
-
986
- #### Returns
987
-
988
- `Promise`\<`object`\>
989
-
990
- 返回一个 Promise,写入完成后 resolve。
991
-
992
- #### Remarks
993
-
994
- #### Example
995
-
996
- ```typescript
997
- import { setStorage } from '@doubao-apps/framework/api';
998
-
999
- await setStorage({
1000
- key: 'profile',
1001
- data: { name: 'Tom', age: 18 },
1002
- });
1003
- ```
1004
-
1005
- <a id="setstoragesync"></a>
1006
- ### setStorageSync()
1007
-
1008
- > **setStorageSync**\<`TData`\>(`params`): `object`
1009
-
1010
- 将数据写入本地缓存。
1011
-
1012
- #### Type parameters
1013
-
1014
- • **TData** = `unknown`
1015
-
1016
- #### Parameters
1017
-
1018
- • **params**: [`SetStorageParams`](#setstorageparamstdata)\<`TData`\>
1019
-
1020
- 存储参数,字段见 [SetStorageParams](#setstorageparamstdata)。
1021
-
1022
- #### Returns
1023
-
1024
- `object`
1025
-
1026
- 同步写入完成后返回。
1027
-
1028
- #### Remarks
1029
-
1030
- #### Example
1031
-
1032
- ```typescript
1033
- import { setStorageSync } from '@doubao-apps/framework/api';
1034
-
1035
- setStorageSync({
1036
- key: 'profile',
1037
- data: { name: 'Tom', age: 18 },
1038
- });
1039
- ```
1040
-
1041
- <a id="getstorage"></a>
1042
- ### getStorage()
1043
-
1044
- > **getStorage**\<`TData`\>(`params`): `Promise`\<[`GetStorageResult`](#getstorageresulttdata)\<`TData`\>\>
1045
-
1046
- 从本地缓存读取数据。
1047
-
1048
- #### Type parameters
1049
-
1050
- • **TData** = `unknown`
1051
-
1052
- #### Parameters
1053
-
1054
- • **params**: [`GetStorageParams`](#getstorageparams)
1055
-
1056
- 查询参数,字段见 [GetStorageParams](#getstorageparams)。
1057
-
1058
- #### Returns
1059
-
1060
- `Promise`\<[`GetStorageResult`](#getstorageresulttdata)\<`TData`\>\>
1061
-
1062
- 返回一个 Promise,解析为 [GetStorageResult](#getstorageresulttdata)。
1063
-
1064
- #### Remarks
1065
-
1066
- #### Example
1067
-
1068
- ```typescript
1069
- import { getStorage } from '@doubao-apps/framework/api';
1070
-
1071
- const result = await getStorage<{ name: string; age: number }>({
1072
- key: 'profile',
1073
- });
1074
-
1075
- console.log(result.data.name, result.data.age);
1076
- ```
1077
-
1078
- <a id="getstoragesync"></a>
1079
- ### getStorageSync()
1080
-
1081
- > **getStorageSync**\<`TData`\>(`params`): [`GetStorageResult`](#getstorageresulttdata)\<`TData`\>
1082
-
1083
- 从本地缓存同步读取数据。
1084
-
1085
- #### Type parameters
1086
-
1087
- • **TData** = `unknown`
1088
-
1089
- #### Parameters
1090
-
1091
- • **params**: [`GetStorageParams`](#getstorageparams)
1092
-
1093
- 查询参数,字段见 [GetStorageParams](#getstorageparams)。
1094
-
1095
- #### Returns
1096
-
1097
- [`GetStorageResult`](#getstorageresulttdata)\<`TData`\>
1098
-
1099
- 返回 [GetStorageResult](#getstorageresulttdata)。
1100
-
1101
- #### Remarks
1102
-
1103
- #### Example
1104
-
1105
- ```typescript
1106
- import { getStorageSync } from '@doubao-apps/framework/api';
1107
-
1108
- const result = getStorageSync<{ name: string; age: number }>({
1109
- key: 'profile',
1110
- });
1111
-
1112
- console.log(result.data.name, result.data.age);
1113
- ```
1114
-
1115
- <a id="removestorage"></a>
1116
- ### removeStorage()
1117
-
1118
- > **removeStorage**(`params`): `Promise`\<`object`\>
1119
-
1120
- 删除本地缓存中指定 key 的数据。
1121
-
1122
- #### Parameters
1123
-
1124
- • **params**: [`RemoveStorageParams`](#removestorageparams)
1125
-
1126
- 删除参数,字段见 [RemoveStorageParams](#removestorageparams)。
1127
-
1128
- #### Returns
1129
-
1130
- `Promise`\<`object`\>
1131
-
1132
- 返回一个 Promise,删除完成后 resolve。
1133
-
1134
- #### Example
1135
-
1136
- ```typescript
1137
- import { removeStorage } from '@doubao-apps/framework/api';
1138
-
1139
- await removeStorage({ key: 'profile' });
1140
- ```
1141
-
1142
- <a id="removestoragesync"></a>
1143
- ### removeStorageSync()
1144
-
1145
- > **removeStorageSync**(`params`?): `object`
1146
-
1147
- 删除本地缓存中指定 key 的数据。
1148
-
1149
- #### Parameters
1150
-
1151
- • **params?**: [`RemoveStorageParams`](#removestorageparams)
1152
-
1153
- 删除参数,字段见 [RemoveStorageParams](#removestorageparams)。
1154
-
1155
- #### Returns
1156
-
1157
- `object`
1158
-
1159
- 同步删除完成后返回。
1160
-
1161
- #### Example
1162
-
1163
- ```typescript
1164
- import { removeStorageSync } from '@doubao-apps/framework/api';
1165
-
1166
- removeStorageSync({ key: 'profile' });
1167
- ```
1168
-
1169
- <a id="clearstorage"></a>
1170
- ### clearStorage()
1171
-
1172
- > **clearStorage**(`params`?): `Promise`\<`object`\>
1173
-
1174
- 清空本地缓存。
1175
-
1176
- #### Parameters
1177
-
1178
- • **params?**: `object`
1179
-
1180
- #### Returns
1181
-
1182
- `Promise`\<`object`\>
1183
-
1184
- 返回一个 Promise,清空完成后 resolve。
1185
-
1186
- #### Example
1187
-
1188
- ```typescript
1189
- import { clearStorage } from '@doubao-apps/framework/api';
1190
-
1191
- await clearStorage();
1192
- ```
1193
-
1194
- <a id="clearstoragesync"></a>
1195
- ### clearStorageSync()
1196
-
1197
- > **clearStorageSync**(`params`?): `object`
1198
-
1199
- 清空本地缓存。
1200
-
1201
- #### Parameters
1202
-
1203
- • **params?**: `object`
1204
-
1205
- #### Returns
1206
-
1207
- `object`
1208
-
1209
- 同步清空完成后返回。
1210
-
1211
- #### Example
1212
-
1213
- ```typescript
1214
- import { clearStorageSync } from '@doubao-apps/framework/api';
1215
-
1216
- clearStorageSync();
1217
- ```
1218
-
1219
- <a id="getstorageinfo"></a>
1220
- ### getStorageInfo()
1221
-
1222
- > **getStorageInfo**(`params`?): `Promise`\<[`GetStorageInfoResult`](#getstorageinforesult)\>
1223
-
1224
- 获取本地缓存信息。
1225
-
1226
- #### Parameters
1227
-
1228
- • **params?**
1229
-
1230
- #### Returns
1231
-
1232
- `Promise`\<[`GetStorageInfoResult`](#getstorageinforesult)\>
1233
-
1234
- 返回一个 Promise,解析为 [GetStorageInfoResult](#getstorageinforesult)。
1235
-
1236
- #### Example
1237
-
1238
- ```typescript
1239
- import { getStorageInfo } from '@doubao-apps/framework/api';
1240
-
1241
- const result = await getStorageInfo();
1242
-
1243
- console.log(result.keys, result.currentSize, result.limitSize);
1244
- ```
1245
-
1246
- <a id="getstorageinfosync"></a>
1247
- ### getStorageInfoSync()
1248
-
1249
- > **getStorageInfoSync**(`params`?): [`GetStorageInfoResult`](#getstorageinforesult)
1250
-
1251
- 同步获取本地缓存信息。
1252
-
1253
- #### Parameters
1254
-
1255
- • **params?**
1256
-
1257
- #### Returns
1258
-
1259
- [`GetStorageInfoResult`](#getstorageinforesult)
1260
-
1261
- 返回 [GetStorageInfoResult](#getstorageinforesult)。
1262
-
1263
- #### Example
1264
-
1265
- ```typescript
1266
- import { getStorageInfoSync } from '@doubao-apps/framework/api';
1267
-
1268
- const result = getStorageInfoSync();
1269
-
1270
- console.log(result.keys, result.currentSize, result.limitSize);
1271
- ```
1272
-
1273
- <a id="getwindowinfosync"></a>
1274
- ### getWindowInfoSync()
1275
-
1276
- > **getWindowInfoSync**(`_param`?): [`GetWindowInfoResult`](#getwindowinforesult)
1277
-
1278
- 获取窗口信息。
1279
-
1280
- #### Parameters
1281
-
1282
- • **\_param?**
1283
-
1284
- #### Returns
1285
-
1286
- [`GetWindowInfoResult`](#getwindowinforesult)
1287
-
1288
- 返回窗口尺寸、状态栏高度和安全区域等信息,字段见 [GetWindowInfoResult](#getwindowinforesult)。
1289
-
1290
- #### Example
1291
-
1292
- ```typescript
1293
- import { getWindowInfoSync } from '@doubao-apps/framework/api';
1294
-
1295
- const result = getWindowInfoSync();
1296
-
1297
- console.log(result.windowWidth, result.windowHeight);
1298
- console.log(result.safeArea?.top, result.screenTop);
1299
- ```
1300
-
1301
- <a id="getsystemsetting"></a>
1302
- ### getSystemSetting()
1303
-
1304
- > **getSystemSetting**(`params`?): [`GetSystemSettingResult`](#getsystemsettingresult)
1305
-
1306
- 获取设备设置。
1307
-
1308
- #### Parameters
1309
-
1310
- • **params?**
1311
-
1312
- #### Returns
1313
-
1314
- [`GetSystemSettingResult`](#getsystemsettingresult)
1315
-
1316
- 返回蓝牙、定位、Wi-Fi 系统开关和设备方向等字段,见 [GetSystemSettingResult](#getsystemsettingresult)。
1317
-
1318
- #### Example
1319
-
1320
- ```typescript
1321
- import { getSystemSetting } from '@doubao-apps/framework/api';
1322
-
1323
- const result = getSystemSetting();
1324
-
1325
- console.log(result.bluetoothEnabled, result.locationEnabled);
1326
- console.log(result.wifiEnabled, result.deviceOrientation);
1327
- ```
1328
-
1329
- <a id="getappbaseinfosync"></a>
1330
- ### getAppBaseInfoSync()
1331
-
1332
- > **getAppBaseInfoSync**(`_params`?): [`GetAppBaseInfoResult`](#getappbaseinforesult)
1333
-
1334
- 获取应用基础信息。
1335
-
1336
- #### Parameters
1337
-
1338
- • **\_params?**
1339
-
1340
- #### Returns
1341
-
1342
- [`GetAppBaseInfoResult`](#getappbaseinforesult)
1343
-
1344
- 返回 SDK 版本、调试开关、宿主信息、语言和主题等字段,见 [GetAppBaseInfoResult](#getappbaseinforesult)。
1345
-
1346
- #### Example
1347
-
1348
- ```typescript
1349
- import { getAppBaseInfoSync } from '@doubao-apps/framework/api';
1350
-
1351
- const result = getAppBaseInfoSync();
1352
-
1353
- console.log(result.language, result.SDKVersion, result.theme);
1354
- console.log(result.host?.appId, result.enableDebug);
1355
- ```
1356
-
1357
- <a id="getwindowinfo"></a>
1358
- ### getWindowInfo()
1359
-
1360
- > **getWindowInfo**(`_params`?): `Promise`\<[`GetWindowInfoResult`](#getwindowinforesult)\>
1361
-
1362
- 获取窗口信息。
1363
-
1364
- #### Parameters
1365
-
1366
- • **\_params?**
1367
-
1368
- #### Returns
1369
-
1370
- `Promise`\<[`GetWindowInfoResult`](#getwindowinforesult)\>
1371
-
1372
- 返回窗口尺寸、状态栏高度和安全区域等信息,字段见 [GetWindowInfoResult](#getwindowinforesult)。
1373
-
1374
- #### Example
1375
-
1376
- ```typescript
1377
- import { getWindowInfo } from '@doubao-apps/framework/api';
1378
-
1379
- const result = await getWindowInfo();
1380
-
1381
- console.log(result.windowWidth, result.windowHeight);
1382
- console.log(result.safeArea?.top, result.screenTop);
1383
- ```
1384
-
1385
- <a id="getappbaseinfo"></a>
1386
- ### getAppBaseInfo()
1387
-
1388
- > **getAppBaseInfo**(`params`?): `Promise`\<[`GetAppBaseInfoResult`](#getappbaseinforesult)\>
1389
-
1390
- 获取应用基础信息。
1391
-
1392
- #### Parameters
1393
-
1394
- • **params?**
1395
-
1396
- #### Returns
1397
-
1398
- `Promise`\<[`GetAppBaseInfoResult`](#getappbaseinforesult)\>
1399
-
1400
- 返回 SDK 版本、调试开关、宿主信息、语言和主题等字段,见 [GetAppBaseInfoResult](#getappbaseinforesult)。
1401
-
1402
- #### Example
1403
-
1404
- ```typescript
1405
- import { getAppBaseInfo } from '@doubao-apps/framework/api';
1406
-
1407
- const result = await getAppBaseInfo();
1408
-
1409
- console.log(result.language, result.SDKVersion, result.theme);
1410
- console.log(result.host?.appId, result.enableDebug);
1411
- ```
1412
-
1413
- ## 相关类型
1414
-
1415
- <a id="getaccountinforesult"></a>
1416
- ### GetAccountInfoResult
1417
-
1418
- 获取当前账号信息。
1419
-
1420
- #### Properties
1421
-
1422
- ##### miniProgram
1423
-
1424
- > **miniProgram**: [`DoubaoAppAccountInfo`](#doubaoappaccountinfo)
1425
-
1426
- 豆包 App账号信息
1427
-
1428
- ##### plugin?
1429
-
1430
- > `optional` **plugin**: [`PluginAccountInfo`](#pluginaccountinfo)
1431
-
1432
- 插件账号信息(仅在插件中调用时包含)
1433
-
1434
- <a id="doubaoappaccountinfo"></a>
1435
- ### DoubaoAppAccountInfo
1436
-
1437
- 豆包 App 账号信息。
1438
-
1439
- #### Properties
1440
-
1441
- ##### appId
1442
-
1443
- > **appId**: `string`
1444
-
1445
- 豆包 App appId
1446
-
1447
- ##### envVersion
1448
-
1449
- > **envVersion**: `"develop"` \| `"trial"` \| `"release"`
1450
-
1451
- 豆包 App 运行环境。
1452
-
1453
- - develop: 开发版
1454
- - trial: 体验版
1455
- - release: 正式版
1456
-
1457
- ##### version
1458
-
1459
- > **version**: `string`
1460
-
1461
- 线上豆包 App 版本号。
1462
-
1463
- <a id="pluginaccountinfo"></a>
1464
- ### PluginAccountInfo
1465
-
1466
- 插件账号信息(仅在插件中调用时包含)。
1467
-
1468
- #### Properties
1469
-
1470
- ##### appId
1471
-
1472
- > **appId**: `string`
1473
-
1474
- 插件 appId
1475
-
1476
- ##### version
1477
-
1478
- > **version**: `string`
1479
-
1480
- 插件版本号,'a.b.c' 形式
1481
-
1482
- <a id="authorizerequest"></a>
1483
- ### AuthorizeRequest
1484
-
1485
- #### Properties
1486
-
1487
- ##### scope
1488
-
1489
- > **scope**: [`Scope`](#scope-1)
1490
-
1491
- 授权范围
1492
-
1493
- <a id="scope-1"></a>
1494
- <a id="scope"></a>
1495
- ### Scope
1496
-
1497
- > **Scope**: `"scope.userLocation"` \| `"scope.userFuzzyLocation"` \| `"scope.userLocationBackground"` \| `"scope.payment"` \| `"scope.record"` \| `"scope.bluetooth"` \| `"scope.camera"` \| `"scope.addPhoneContact"` \| `"scope.addPhoneCalendar"`
1498
-
1499
- <a id="caniuseparams"></a>
1500
- ### CanIUseParams
1501
-
1502
- #### Properties
1503
-
1504
- ##### schema
1505
-
1506
- > **schema**: `string`
1507
-
1508
- <a id="caniuseresult"></a>
1509
- ### CanIUseResult
1510
-
1511
- #### Properties
1512
-
1513
- ##### result
1514
-
1515
- > **result**: `boolean`
1516
-
1517
- <a id="getlocationparams"></a>
1518
- ### GetLocationParams
1519
-
1520
- #### Properties
1521
-
1522
- ##### maxCacheMs?
1523
-
1524
- > `optional` **maxCacheMs**: `number`
1525
-
1526
- 缓存时间,单位毫秒,默认为0
1527
-
1528
- ##### mode?
1529
-
1530
- > `optional` **mode**: `number`
1531
-
1532
- 定位模式
1533
- 0:低功耗
1534
- 1:仅设备
1535
- 2:高精度(默认)
1536
-
1537
- ##### source?
1538
-
1539
- > `optional` **source**: `string`
1540
-
1541
- 调用业务方
1542
-
1543
- ##### timeoutMs?
1544
-
1545
- > `optional` **timeoutMs**: `number`
1546
-
1547
- 超时时间,单位毫秒,默认 30000
1548
-
1549
- <a id="getlocationresponse"></a>
1550
- ### GetLocationResponse
1551
-
1552
- #### Properties
1553
-
1554
- ##### accuracy
1555
-
1556
- > **accuracy**: `number`
1557
-
1558
- 定位精度,单位:米
1559
-
1560
- ##### latitude
1561
-
1562
- > **latitude**: `number`
1563
-
1564
- 纬度
1565
-
1566
- ##### longitude
1567
-
1568
- > **longitude**: `number`
1569
-
1570
- 经度
1571
-
1572
- ##### speed
1573
-
1574
- > **speed**: `number`
1575
-
1576
- 行进速度,单位:米/秒
1577
-
1578
- ##### timestamp
1579
-
1580
- > **timestamp**: `string`
1581
-
1582
- 时间戳
1583
-
1584
- <a id="showmodalparams"></a>
1585
- ### ShowModalParams
1586
-
1587
- 显示模态对话框的参数。
1588
-
1589
- #### Properties
1590
-
1591
- ##### cancelText?
1592
-
1593
- > `optional` **cancelText**: `string`
1594
-
1595
- 取消按钮的文字。
1596
-
1597
- ##### confirmText?
1598
-
1599
- > `optional` **confirmText**: `string`
1600
-
1601
- 确认按钮的文字。
1602
-
1603
- ##### content
1604
-
1605
- > **content**: `string`
1606
-
1607
- 模态对话框的内容。
1608
-
1609
- ##### showCancel?
1610
-
1611
- > `optional` **showCancel**: `boolean`
1612
-
1613
- 是否显示取消按钮,默认 `true`。
1614
-
1615
- ##### tapMaskToDismiss?
1616
-
1617
- > `optional` **tapMaskToDismiss**: `boolean`
1618
-
1619
- 是否允许点击蒙层关闭对话框,默认 `false`。
1620
-
1621
- ##### title?
1622
-
1623
- > `optional` **title**: `string`
1624
-
1625
- 模态对话框的标题。
1626
-
1627
- <a id="showmodalresult"></a>
1628
- ### ShowModalResult
1629
-
1630
- 显示模态对话框的返回结果。
1631
-
1632
- #### Properties
1633
-
1634
- ##### action
1635
-
1636
- > **action**: `"confirm"` \| `"cancel"` \| `"mask"`
1637
-
1638
- 用户点击的动作。
1639
-
1640
- <a id="showloadingparams"></a>
1641
- ### ShowLoadingParams
1642
-
1643
- 显示 loading 提示框的参数。
1644
-
1645
- <a id="hideinteractionparams"></a>
1646
- ### HideInteractionParams
1647
-
1648
- 隐藏交互提示框的公共参数。
1649
-
1650
- <a id="showactionsheetparams"></a>
1651
- ### ShowActionSheetParams
1652
-
1653
- 显示操作菜单的参数。
1654
-
1655
- #### Properties
1656
-
1657
- ##### itemColor?
1658
-
1659
- > `optional` **itemColor**: `string`
1660
-
1661
- 按钮文字颜色。
1662
-
1663
- ##### itemList
1664
-
1665
- > **itemList**: `string`[]
1666
-
1667
- 按钮文字数组。
1668
-
1669
- ##### title?
1670
-
1671
- > `optional` **title**: `string`
1672
-
1673
- 标题
1674
-
1675
- <a id="showactionsheetresult"></a>
1676
- ### ShowActionSheetResult
1677
-
1678
- 显示操作菜单的返回结果。
1679
-
1680
- #### Properties
1681
-
1682
- ##### tapIndex
1683
-
1684
- > **tapIndex**: `number`
1685
-
1686
- 用户点击的按钮序号,从 0 开始。
1687
-
1688
- <a id="menubuttonboundingclientrect"></a>
1689
- ### MenuButtonBoundingClientRect
1690
-
1691
- 菜单按钮的布局位置信息。
1692
-
1693
- #### Properties
1694
-
1695
- ##### bottom
1696
-
1697
- > **bottom**: `number`
1698
-
1699
- 下边界坐标,单位 px。
1700
-
1701
- ##### height
1702
-
1703
- > **height**: `number`
1704
-
1705
- 高度,单位 px。
1706
-
1707
- ##### left
1708
-
1709
- > **left**: `number`
1710
-
1711
- 左边界坐标,单位 px。
1712
-
1713
- ##### right
1714
-
1715
- > **right**: `number`
1716
-
1717
- 右边界坐标,单位 px。
1718
-
1719
- ##### top
1720
-
1721
- > **top**: `number`
1722
-
1723
- 上边界坐标,单位 px。
1724
-
1725
- ##### width
1726
-
1727
- > **width**: `number`
1728
-
1729
- 宽度,单位 px。
1730
-
1731
- <a id="enablealertbeforeunloadparams"></a>
1732
- ### EnableAlertBeforeUnloadParams
1733
-
1734
- 开启返回前提醒的参数。
1735
-
1736
- #### Properties
1737
-
1738
- ##### message
1739
-
1740
- > **message**: `string`
1741
-
1742
- 返回前确认弹窗的文案。
1743
-
1744
- <a id="showtoastparams"></a>
1745
- ### ShowToastParams
1746
-
1747
- #### Properties
1748
-
1749
- ##### customIcon?
1750
-
1751
- > `optional` **customIcon**: `string`
1752
-
1753
- ##### duration?
1754
-
1755
- > `optional` **duration**: `number`
1756
-
1757
- ##### icon?
1758
-
1759
- > `optional` **icon**: `"success"` \| `"error"` \| `"warn"`
1760
-
1761
- ##### message
1762
-
1763
- > **message**: `string`
1764
-
1765
- ##### type?
1766
-
1767
- > `optional` **type**: `"default"` \| `"success"` \| `"error"` \| `"warning"`
1768
-
1769
- <a id="dispatchactiondirectiveparams"></a>
1770
- ### DispatchActionDirectiveParams
1771
-
1772
- 下发动作指令的请求参数。
1773
-
1774
- #### Properties
1775
-
1776
- ##### actionDescribe
1777
-
1778
- > **actionDescribe**: `string`
1779
-
1780
- 自然语言描述,例如:用户点击支付按钮并完成话费支付
1781
-
1782
- ##### actionType
1783
-
1784
- > **actionType**: [`ActionDirectiveType`](#actiondirectivetype)
1785
-
1786
- 动作类型,参见 [ActionDirectiveType](#actiondirectivetype)
1787
-
1788
- ##### expectedAction
1789
-
1790
- > **expectedAction**: `string`
1791
-
1792
- 自然语言描述,例如:调用话费账单查询工具,基于工具返回回复用户。如果有卡片需要引用卡片
1793
-
1794
- ##### responseHint?
1795
-
1796
- > `optional` **responseHint**: `string`
1797
-
1798
- 自然语言描述,例如:严格参照提供的工具入参来调用工具,不要调用除bill_check以外的其他工具,只能严格基于bill_check工具返回结果进行回复
1799
-
1800
- ##### toolName?
1801
-
1802
- > `optional` **toolName**: `string`
1803
-
1804
- mcp名称,如果expectedAction里预期要调用工具,需要在这里写明调用工具的mcp name
1805
-
1806
- ##### toolParams?
1807
-
1808
- > `optional` **toolParams**: `Record`\<`string`, `string`\>
1809
-
1810
- mcp入参,如果expectedAction里预期要调用工具,需要在这里写明调用工具的入参
1811
-
1812
- ##### widgetInstanceId
1813
-
1814
- > **widgetInstanceId**: `string`
1815
-
1816
- 会话消息关联的卡片ID
1817
-
1818
- <a id="actiondirectivetype"></a>
1819
- ### ActionDirectiveType
1820
-
1821
- 用户动作指令类型。
1822
-
1823
- #### Enumeration Members
1824
-
1825
- ##### BUTTON\_CLICK
1826
-
1827
- > **BUTTON\_CLICK**: `"button_click"`
1828
-
1829
- 按钮点击
1830
-
1831
- ##### FORM\_SUBMIT
1832
-
1833
- > **FORM\_SUBMIT**: `"form_submit"`
1834
-
1835
- 表单提交(复杂的信息提交场景)
1836
-
1837
- ##### OPTION\_SELECT
1838
-
1839
- > **OPTION\_SELECT**: `"option_select"`
1840
-
1841
- 选择(下拉列表场景)
1842
-
1843
- <a id="expiredwidgetparams"></a>
1844
- ### ExpiredWidgetParams
1845
-
1846
- #### Properties
1847
-
1848
- ##### detailText?
1849
-
1850
- > `optional` **detailText**: `string`
1851
-
1852
- 点击失效卡要跳转的页面 detailText
1853
-
1854
- ##### ~~schema?~~
1855
-
1856
- > `optional` **schema**: `string`
1857
-
1858
- 点击失效卡要跳转的页面 schema,格式与 navigateTo 的 url 相同
1859
-
1860
- ###### Deprecated
1861
-
1862
- 使用 url 字段替代 schema 字段,后续版本将移除 schema 字段,请尽快迁移到 url 字段
1863
-
1864
- ##### title?
1865
-
1866
- > `optional` **title**: `string`
1867
-
1868
- 点击失效卡要跳转的页面 title
1869
-
1870
- ##### url?
1871
-
1872
- > `optional` **url**: `string`
1873
-
1874
- 点击失效卡要跳转的页面 url 或 sslocal schema
1875
-
1876
- ##### widgetInstanceId
1877
-
1878
- > **widgetInstanceId**: `string`
1879
-
1880
- 卡片实例 ID,在卡片环境通过getWidgetInstanceId来获取,其他环境(比如页面)需要通过传参或通信的方式传递过去
1881
-
1882
- <a id="loginwithwidgetrequest"></a>
1883
- ### LoginWithWidgetRequest
1884
-
1885
- #### Properties
1886
-
1887
- ##### loginType
1888
-
1889
- > **loginType**: [`LoginType`](#logintype-1)
1890
-
1891
- Login type identifier
1892
-
1893
- <a id="loginwithwidgetresult"></a>
1894
- ### LoginWithWidgetResult
1895
-
1896
- #### Properties
1897
-
1898
- ##### result
1899
-
1900
- > **result**: `boolean`
1901
-
1902
- Whether the login is successful
1903
-
1904
- <a id="logintype-1"></a>
1905
- <a id="logintype"></a>
1906
- ### LoginType
1907
-
1908
- > **LoginType**: `0` \| `1` \| `2` \| `3`
1909
-
1910
- Widget 登录类型。
1911
-
1912
- - `0`: 隐私协议登录
1913
- - `1`: 仅登录
1914
- - `2`: 先登录再隐私协议,两次弹窗
1915
- - `3`: 登录和隐私协议合并,一次弹窗
1916
-
1917
- <a id="loginrequest"></a>
1918
- ### LoginRequest
1919
-
1920
- #### Properties
1921
-
1922
- ##### timeout?
1923
-
1924
- > `optional` **timeout**: `number`
1925
-
1926
- Timeout in milliseconds
1927
-
1928
- <a id="loginresult"></a>
1929
- ### LoginResult
1930
-
1931
- #### Properties
1932
-
1933
- ##### code
1934
-
1935
- > **code**: `string`
1936
-
1937
- Login credential code
1938
-
1939
- <a id="postloginresultrequest"></a>
1940
- ### PostLoginResultRequest
1941
-
1942
- #### Properties
1943
-
1944
- ##### code?
1945
-
1946
- > `optional` **code**: `string`
1947
-
1948
- Authorization login credential, valid when login result is true
1949
-
1950
- ##### result
1951
-
1952
- > **result**: `boolean`
1953
-
1954
- Login result, true means success, false means failure
1955
-
1956
- <a id="createsignorderparams"></a>
1957
- ### CreateSignOrderParams
1958
-
1959
- #### Properties
1960
-
1961
- ##### data
1962
-
1963
- > **data**: `string`
1964
-
1965
- 签约订单请求数据。
1966
-
1967
- ##### dbAuthorization
1968
-
1969
- > **dbAuthorization**: `string`
1970
-
1971
- 签约订单授权信息。
1972
-
1973
- <a id="createsignorderresult"></a>
1974
- ### CreateSignOrderResult
1975
-
1976
- > **CreateSignOrderResult**: [`CreateSignOrderSuccessResult`](#createsignordersuccessresult) \| [`CreateSignOrderFailResult`](#createsignorderfailresult)
1977
-
1978
- <a id="createsignorderfailresult"></a>
1979
- ### CreateSignOrderFailResult
1980
-
1981
- #### Properties
1982
-
1983
- ##### errLogId?
1984
-
1985
- > `optional` **errLogId**: `string`
1986
-
1987
- 用于问题排查的错误日志 ID。
1988
-
1989
- ##### errMsg
1990
-
1991
- > **errMsg**: `string`
1992
-
1993
- 错误信息。
1994
-
1995
- ##### errNo
1996
-
1997
- > **errNo**: `string`
1998
-
1999
- 错误码。
2000
-
2001
- <a id="createsignordersuccessresult"></a>
2002
- ### CreateSignOrderSuccessResult
2003
-
2004
- #### Properties
2005
-
2006
- ##### authOrderId
2007
-
2008
- > **authOrderId**: `string`
2009
-
2010
- 签约订单 ID。
2011
-
2012
- ##### logId
2013
-
2014
- > **logId**: `string`
2015
-
2016
- 用于问题排查的日志 ID。
2017
-
2018
- <a id="getorderpaymentresult"></a>
2019
- ### GetOrderPaymentResult
2020
-
2021
- #### Properties
2022
-
2023
- ##### logId
2024
-
2025
- > **logId**: `string`
2026
-
2027
- 用于问题排查的日志 ID。
2028
-
2029
- ##### orderId
2030
-
2031
- > **orderId**: `string`
2032
-
2033
- 订单 ID。
2034
-
2035
- <a id="getorderpaymentwithsignparams"></a>
2036
- ### GetOrderPaymentWithSignParams
2037
-
2038
- #### Properties
2039
-
2040
- ##### orderId
2041
-
2042
- > **orderId**: `string`
2043
-
2044
- 订单 ID。
2045
-
2046
- ##### signData
2047
-
2048
- > **signData**: `string`
2049
-
2050
- 支付签名数据。
2051
-
2052
- ##### signDbAuthorization
2053
-
2054
- > **signDbAuthorization**: `string`
2055
-
2056
- 签名支付授权信息。
2057
-
2058
- <a id="getorderpaymentparams"></a>
2059
- ### GetOrderPaymentParams
2060
-
2061
- #### Properties
2062
-
2063
- ##### orderId
2064
-
2065
- > **orderId**: `string`
2066
-
2067
- 订单 ID。
2068
-
2069
- <a id="requestcombineorderparams"></a>
2070
- ### RequestCombineOrderParams
2071
-
2072
- #### Properties
2073
-
2074
- ##### data
2075
-
2076
- > **data**: `string`
2077
-
2078
- 合单订单请求数据。
2079
-
2080
- ##### dbAuthorization
2081
-
2082
- > **dbAuthorization**: `string`
2083
-
2084
- 合单订单授权信息。
2085
-
2086
- <a id="requestcombineorderresult"></a>
2087
- ### RequestCombineOrderResult
2088
-
2089
- > **RequestCombineOrderResult**: [`RequestCombineOrderSuccessResult`](#requestcombineordersuccessresult) \| [`RequestCombineOrderFailResult`](#requestcombineorderfailresult)
2090
-
2091
- <a id="requestcombineorderfailresult"></a>
2092
- ### RequestCombineOrderFailResult
2093
-
2094
- #### Properties
2095
-
2096
- ##### errLogId?
2097
-
2098
- > `optional` **errLogId**: `string`
2099
-
2100
- 用于问题排查的错误日志 ID。
2101
-
2102
- ##### errMsg
2103
-
2104
- > **errMsg**: `string`
2105
-
2106
- 错误信息。
2107
-
2108
- ##### errNo
2109
-
2110
- > **errNo**: `string`
2111
-
2112
- 错误码。
2113
-
2114
- <a id="requestcombineordersuccessresult"></a>
2115
- ### RequestCombineOrderSuccessResult
2116
-
2117
- #### Properties
2118
-
2119
- ##### combineOrderId
2120
-
2121
- > **combineOrderId**: `string`
2122
-
2123
- 合单订单 ID。
2124
-
2125
- ##### logId
2126
-
2127
- > **logId**: `string`
2128
-
2129
- 用于问题排查的日志 ID。
2130
-
2131
- <a id="requestorderparams"></a>
2132
- ### RequestOrderParams
2133
-
2134
- #### Properties
2135
-
2136
- ##### data
2137
-
2138
- > **data**: `string`
2139
-
2140
- ##### dbAuthorization
2141
-
2142
- > **dbAuthorization**: `string`
2143
-
2144
- <a id="requestorderresult"></a>
2145
- ### RequestOrderResult
2146
-
2147
- #### Properties
2148
-
2149
- ##### logId
2150
-
2151
- > **logId**: `string`
2152
-
2153
- ##### orderId
2154
-
2155
- > **orderId**: `string`
2156
-
2157
- <a id="signparams"></a>
2158
- ### SignParams
2159
-
2160
- #### Properties
2161
-
2162
- ##### orderId
2163
-
2164
- > **orderId**: `string`
2165
-
2166
- 签约订单 ID。
2167
-
2168
- <a id="signresult"></a>
2169
- ### SignResult
2170
-
2171
- > **SignResult**: [`SignSuccessResult`](#signsuccessresult) \| [`SignFailResult`](#signfailresult)
2172
-
2173
- <a id="signfailresult"></a>
2174
- ### SignFailResult
2175
-
2176
- #### Properties
2177
-
2178
- ##### code
2179
-
2180
- > **code**: `number`
2181
-
2182
- 错误码。
2183
-
2184
- ##### errLogId?
2185
-
2186
- > `optional` **errLogId**: `string`
2187
-
2188
- 用于问题排查的错误日志 ID。
2189
-
2190
- ##### errMsg
2191
-
2192
- > **errMsg**: `string`
2193
-
2194
- 错误信息。
2195
-
2196
- ##### errNo
2197
-
2198
- > **errNo**: `string`
2199
-
2200
- 错误编号。
2201
-
2202
- <a id="signsuccessresult"></a>
2203
- ### SignSuccessResult
2204
-
2205
- > **SignSuccessResult**: `Record`\<`string`, `never`\>
2206
-
2207
- <a id="privacysettingresult"></a>
2208
- ### PrivacySettingResult
2209
-
2210
- #### Properties
2211
-
2212
- ##### needAuthorization
2213
-
2214
- > **needAuthorization**: `boolean`
2215
-
2216
- Whether user authorization for privacy agreement is required
2217
-
2218
- <a id="sendquerymessageparams"></a>
2219
- ### SendQueryMessageParams
2220
-
2221
- #### Properties
2222
-
2223
- ##### content
2224
-
2225
- > **content**: `string`
2226
-
2227
- 要发送的消息。根据类型不同,序列化方式可能不同
2228
-
2229
- ##### type
2230
-
2231
- > **type**: `"text"`
2232
-
2233
- 消息类型,目前仅支持 text
2234
-
2235
- <a id="setadditionalcontextparams"></a>
2236
- ### SetAdditionalContextParams
2237
-
2238
- #### Properties
2239
-
2240
- ##### additionalContext
2241
-
2242
- > **additionalContext**: `string`
2243
-
2244
- 上下文内容
2245
-
2246
- ##### botId?
2247
-
2248
- > `optional` **botId**: `string`
2249
-
2250
- 指定 bot id
2251
-
2252
- <a id="updatemodelcontextparams"></a>
2253
- ### UpdateModelContextParams
2254
-
2255
- #### Properties
2256
-
2257
- ##### content
2258
-
2259
- > **content**: `string`
2260
-
2261
- 上下文内容,格式无约束,可以与 MCP 服务下发的上下文格式保持一致
2262
-
2263
- ##### entityId?
2264
-
2265
- > `optional` **entityId**: `string`
2266
-
2267
- 上下文所属的 entityID,业务侧管理
2268
-
2269
- ##### taskId?
2270
-
2271
- > `optional` **taskId**: `string`
2272
-
2273
- 上下文所属任务 ID,业务侧定义
2274
-
2275
- <a id="updatewidgetparams"></a>
2276
- ### UpdateWidgetParams
2277
-
2278
- #### Properties
2279
-
2280
- ##### widgetData
2281
-
2282
- > **widgetData**: `string`
2283
-
2284
- 卡片渲染的数据
2285
-
2286
- ##### widgetId?
2287
-
2288
- > `optional` **widgetId**: `string`
2289
-
2290
- 卡片更新的为新的widgetId
2291
-
2292
- ##### widgetInstanceId
2293
-
2294
- > **widgetInstanceId**: `string`
2295
-
2296
- 需要更新的widget 实例 ID
2297
-
2298
- <a id="saveimagetophotosalbumparams"></a>
2299
- ### SaveImageToPhotosAlbumParams
2300
-
2301
- 保存图片到系统相册的请求参数。
2302
-
2303
- #### Properties
2304
-
2305
- ##### filePath
2306
-
2307
- > **filePath**: `string`
2308
-
2309
- 需要保存的图片文件路径。支持临时文件路径或持久文件路径,不支持网络图片路径。
2310
-
2311
- <a id="previewimageparams"></a>
2312
- ### PreviewImageParams
2313
-
2314
- 预览图片的请求参数。
2315
-
2316
- #### Properties
2317
-
2318
- ##### current?
2319
-
2320
- > `optional` **current**: `string` \| `number`
2321
-
2322
- 当前显示图片的链接,或当前显示图片的下标,不填则默认为 urls 中的第一张
2323
-
2324
- ##### referrerPolicy?
2325
-
2326
- > `optional` **referrerPolicy**: `string`
2327
-
2328
- 预览页使用的 Referrer 策略。
2329
-
2330
- ##### showmenu?
2331
-
2332
- > `optional` **showmenu**: `boolean`
2333
-
2334
- 是否显示长按菜单,菜单支持保存图片至本地相册
2335
-
2336
- ##### urls
2337
-
2338
- > **urls**: `string`[]
2339
-
2340
- 需要预览的图片链接列表。
2341
-
2342
- <a id="getimageinfoparams"></a>
2343
- ### GetImageInfoParams
2344
-
2345
- 获取图片信息的请求参数。
2346
-
2347
- #### Properties
2348
-
2349
- ##### src
2350
-
2351
- > **src**: `string`
2352
-
2353
- 图片路径,可以是相对路径、临时文件路径、存储文件路径或网络图片路径。
2354
-
2355
- <a id="getimageinforesult"></a>
2356
- ### GetImageInfoResult
2357
-
2358
- 图片信息结果。
2359
-
2360
- #### Properties
2361
-
2362
- ##### height
2363
-
2364
- > **height**: `number`
2365
-
2366
- 图片原始高度,单位 px,不考虑旋转。
2367
-
2368
- ##### orientation
2369
-
2370
- > **orientation**: [`ImageOrientation`](#imageorientation)
2371
-
2372
- 图片方向。
2373
-
2374
- ##### path
2375
-
2376
- > **path**: `string`
2377
-
2378
- 图片的本地路径。
2379
-
2380
- ##### type
2381
-
2382
- > **type**: `string`
2383
-
2384
- 图片格式。
2385
-
2386
- ##### width
2387
-
2388
- > **width**: `number`
2389
-
2390
- 图片原始宽度,单位 px,不考虑旋转。
2391
-
2392
- <a id="imageorientation"></a>
2393
- ### ImageOrientation
2394
-
2395
- > **ImageOrientation**: `"up"` \| `"up-mirrored"` \| `"down"` \| `"down-mirrored"` \| `"left-mirrored"` \| `"right"` \| `"right-mirrored"` \| `"left"`
2396
-
2397
- 图片方向枚举。
2398
-
2399
- <a id="chooseimageparams"></a>
2400
- ### ChooseImageParams
2401
-
2402
- 选择图片的请求参数。
2403
-
2404
- #### Properties
2405
-
2406
- ##### count?
2407
-
2408
- > `optional` **count**: `number`
2409
-
2410
- 最多可选图片张数。
2411
-
2412
- ##### imageId?
2413
-
2414
- > `optional` **imageId**: `string`
2415
-
2416
- H5 场景下可复用的 input 元素 ID。
2417
-
2418
- ##### sizeType?
2419
-
2420
- > `optional` **sizeType**: [`ChooseImageSizeType`](#chooseimagesizetype)[]
2421
-
2422
- 允许返回的图片尺寸类型。
2423
-
2424
- ##### sourceType?
2425
-
2426
- > `optional` **sourceType**: [`ChooseImageSourceType`](#chooseimagesourcetype)[]
2427
-
2428
- 允许选择的图片来源。
2429
-
2430
- <a id="chooseimageresult"></a>
2431
- ### ChooseImageResult
2432
-
2433
- 选择图片结果。
2434
-
2435
- #### Properties
2436
-
2437
- ##### tempFilePaths
2438
-
2439
- > **tempFilePaths**: `string`[]
2440
-
2441
- 图片临时文件路径列表。
2442
-
2443
- ##### tempFiles
2444
-
2445
- > **tempFiles**: [`ChooseImageFile`](#chooseimagefile)[]
2446
-
2447
- 图片临时文件信息列表。
2448
-
2449
- <a id="chooseimagesizetype"></a>
2450
- ### ChooseImageSizeType
2451
-
2452
- > **ChooseImageSizeType**: `"original"` \| `"compressed"`
2453
-
2454
- 可选的图片尺寸类型。
2455
-
2456
- <a id="chooseimagesourcetype"></a>
2457
- ### ChooseImageSourceType
2458
-
2459
- > **ChooseImageSourceType**: `"album"` \| `"camera"` \| `"user"` \| `"environment"`
2460
-
2461
- 可选的图片来源类型。
2462
-
2463
- <a id="chooseimagefile"></a>
2464
- ### ChooseImageFile
2465
-
2466
- 选择图片返回的单个文件信息。
2467
-
2468
- #### Properties
2469
-
2470
- ##### originalFileObj?
2471
-
2472
- > `optional` **originalFileObj**: `File`
2473
-
2474
- 原始浏览器 File 对象。
2475
-
2476
- ##### path
2477
-
2478
- > **path**: `string`
2479
-
2480
- 本地临时文件路径。
2481
-
2482
- ##### size
2483
-
2484
- > **size**: `number`
2485
-
2486
- 文件大小,单位 B。
2487
-
2488
- ##### type?
2489
-
2490
- > `optional` **type**: `string`
2491
-
2492
- 文件 MIME 类型。
2493
-
2494
- <a id="compressimageparams"></a>
2495
- ### CompressImageParams
2496
-
2497
- 压缩图片的请求参数。
2498
-
2499
- #### Properties
2500
-
2501
- ##### compressedHeight?
2502
-
2503
- > `optional` **compressedHeight**: `number`
2504
-
2505
- 压缩后图片高度,单位 px。
2506
-
2507
- ##### compressedWidth?
2508
-
2509
- > `optional` **compressedWidth**: `number`
2510
-
2511
- 压缩后图片宽度,单位 px。
2512
-
2513
- ##### quality?
2514
-
2515
- > `optional` **quality**: `number`
2516
-
2517
- 压缩质量,范围 0 - 100,仅对 jpg 生效。
2518
-
2519
- ##### src
2520
-
2521
- > **src**: `string`
2522
-
2523
- 图片路径。
2524
-
2525
- <a id="compressimageresult"></a>
2526
- ### CompressImageResult
2527
-
2528
- 压缩图片结果。
2529
-
2530
- #### Properties
2531
-
2532
- ##### tempFilePath
2533
-
2534
- > **tempFilePath**: `string`
2535
-
2536
- 压缩后图片的临时文件路径。
2537
-
2538
- <a id="requestparams"></a>
2539
- ### RequestParams
2540
-
2541
- 网络请求参数。
2542
-
2543
- #### Properties
2544
-
2545
- ##### data?
2546
-
2547
- > `optional` **data**: `string` \| `Record`\<`string`, `any`\> \| `ArrayBuffer`
2548
-
2549
- 请求体数据。
2550
-
2551
- 传给服务器的数据最终会是 `String` 或 `ArrayBuffer`:
2552
- - 若 `data` 是 `string` 或 `ArrayBuffer`,直接使用;
2553
- - 若 `header['content-type']` 是 `application/x-www-form-urlencoded`,会被编码为 query string,例如:`encodeURIComponent(k)=encodeURIComponent(v)`;
2554
- - 若 `header['content-type']` 是 `application/json`,会执行 JSON 序列化;
2555
- - 若 `data` 是普通对象且未命中上述类型,也会执行 JSON 序列化;
2556
- - 其他类型会调用 `toString()`
2557
-
2558
- ##### dataType?
2559
-
2560
- > `optional` **dataType**: `"string"` \| `"json"`
2561
-
2562
- 期望返回的数据格式。
2563
- - `json`: 尝试按 JSON 解析;
2564
- - `string`: 按字符串返回。
2565
-
2566
- ###### Default
2567
-
2568
- ```ts
2569
- "json"
2570
- ```
2571
-
2572
- ##### header?
2573
-
2574
- > `optional` **header**: `Record`\<`string`, `string`\>
2575
-
2576
- 请求 Header。
2577
-
2578
- ###### Default
2579
-
2580
- ```ts
2581
- {"content-type": "application/json"}
2582
- ```
2583
-
2584
- ##### method?
2585
-
2586
- > `optional` **method**: [`RequestMethod`](#requestmethod)
2587
-
2588
- 请求方法。
2589
-
2590
- ###### Default
2591
-
2592
- ```ts
2593
- "GET"
2594
- ```
2595
-
2596
- ##### url
2597
-
2598
- > **url**: `string`
2599
-
2600
- 请求地址,需为完整的 **HTTPS** URL。
2601
-
2602
- <a id="requestresponse"></a>
2603
- ### RequestResponse
2604
-
2605
- 网络请求返回结果。
2606
-
2607
- #### Properties
2608
-
2609
- ##### data?
2610
-
2611
- > `optional` **data**: `string` \| `Record`\<`string`, `any`\> \| `ArrayBuffer`
2612
-
2613
- 响应数据,类型由 `dataType` 决定。
2614
-
2615
- ##### header
2616
-
2617
- > **header**: `Record`\<`string`, `string`\>
2618
-
2619
- HTTP 响应头。
2620
-
2621
- ##### statusCode
2622
-
2623
- > **statusCode**: `number`
2624
-
2625
- HTTP 状态码。
2626
-
2627
- <a id="requestmethod"></a>
2628
- ### RequestMethod
2629
-
2630
- > **RequestMethod**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"HEAD"` \| `"OPTIONS"` \| `"TRACE"` \| `"CONNECT"`
2631
-
2632
- <a id="openapprequest"></a>
2633
- ### OpenAppRequest
2634
-
2635
- #### Properties
2636
-
2637
- ##### fallbackUrl?
2638
-
2639
- > `optional` **fallbackUrl**: `string`
2640
-
2641
- Optional fallback URL when deep link fails
2642
-
2643
- ##### targetPackage?
2644
-
2645
- > `optional` **targetPackage**: `string`
2646
-
2647
- Optional target package name for Android
2648
-
2649
- ##### uri
2650
-
2651
- > **uri**: `string`
2652
-
2653
- Target URI to open, e.g. scheme://path?query
2654
-
2655
- <a id="openappresult"></a>
2656
- ### OpenAppResult
2657
-
2658
- #### Properties
2659
-
2660
- ##### status
2661
-
2662
- > **status**: [`OpenAppStatus`](#openappstatus)
2663
-
2664
- Execution status from client
2665
-
2666
- <a id="openappstatus"></a>
2667
- ### OpenAppStatus
2668
-
2669
- > **OpenAppStatus**: `"deep_link"` \| `"market"` \| `"browser"`
2670
-
2671
- <a id="navigatetoparams"></a>
2672
- ### NavigateToParams
2673
-
2674
- #### Properties
2675
-
2676
- ##### url
2677
-
2678
- > **url**: `string`
2679
-
2680
- 跳转的页面的路径,如 'path?key=value&key2=value2'
2681
-
2682
- <a id="navigatebackparams"></a>
2683
- ### NavigateBackParams
2684
-
2685
- #### Properties
2686
-
2687
- ##### delta?
2688
-
2689
- > `optional` **delta**: `number`
2690
-
2691
- 返回的页面数,如果 delta 大于现有页面数,则返回到页面栈中只剩一个页面为止。
2692
-
2693
- <a id="setstorageparamstdata"></a>
2694
- ### SetStorageParams<TData>
2695
-
2696
- #### Type parameters
2697
-
2698
- • **TData** = `unknown`
2699
-
2700
- #### Properties
2701
-
2702
- ##### data
2703
-
2704
- > **data**: `TData`
2705
-
2706
- 待存储的数据
2707
-
2708
- ##### key
2709
-
2710
- > **key**: `string`
2711
-
2712
- 本地缓存键名
2713
-
2714
- <a id="getstorageparams"></a>
2715
- ### GetStorageParams
2716
-
2717
- #### Properties
2718
-
2719
- ##### key
2720
-
2721
- > **key**: `string`
2722
-
2723
- 本地缓存键名
2724
-
2725
- <a id="getstorageresulttdata"></a>
2726
- ### GetStorageResult<TData>
2727
-
2728
- #### Type parameters
2729
-
2730
- • **TData** = `unknown`
2731
-
2732
- #### Properties
2733
-
2734
- ##### data
2735
-
2736
- > **data**: `TData`
2737
-
2738
- key 对应的数据
2739
-
2740
- <a id="removestorageparams"></a>
2741
- ### RemoveStorageParams
2742
-
2743
- #### Properties
2744
-
2745
- ##### key
2746
-
2747
- > **key**: `string`
2748
-
2749
- 本地缓存键名
2750
-
2751
- <a id="getstorageinforesult"></a>
2752
- ### GetStorageInfoResult
2753
-
2754
- #### Properties
2755
-
2756
- ##### currentSize
2757
-
2758
- > **currentSize**: `number`
2759
-
2760
- 当前占用的空间大小,单位 KB
2761
-
2762
- ##### keys
2763
-
2764
- > **keys**: `string`[]
2765
-
2766
- 当前 storage 中所有的 key
2767
-
2768
- ##### limitSize
2769
-
2770
- > **limitSize**: `number`
2771
-
2772
- 限制的空间大小,单位 KB
355
+ > **result**: `boolean`
2773
356
 
2774
357
  <a id="getwindowinforesult"></a>
2775
358
  ### GetWindowInfoResult