@doubao-apps/ai 0.0.25 → 0.0.27

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 (87) hide show
  1. package/README.md +21 -0
  2. package/dist/994.js +6 -6
  3. package/dist/contexts/doubao-apps-dev/.ai/examples/common-patterns.md +600 -0
  4. package/dist/contexts/doubao-apps-dev/.ai/examples/component-basics.md +509 -0
  5. package/dist/contexts/doubao-apps-dev/.ai/guides/best-practices.md +571 -0
  6. package/dist/contexts/doubao-apps-dev/.ai/guides/component-development.md +857 -0
  7. package/dist/contexts/doubao-apps-dev/.ai/guides/performance-optimization.md +404 -0
  8. package/dist/contexts/doubao-apps-dev/.ai/guides/system-prompt.md +331 -0
  9. package/dist/contexts/doubao-apps-dev/.ai/guides/troubleshooting.md +291 -0
  10. package/dist/contexts/doubao-apps-dev/.ai/reference/components-quick-ref.md +103 -0
  11. package/dist/contexts/doubao-apps-dev/.ai/reference/framework-api-quick-ref.md +537 -0
  12. package/dist/contexts/doubao-apps-dev/.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
  13. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/02-/345/255/230/345/202/250.md +409 -0
  14. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/03-/350/267/257/347/224/261.md +165 -0
  15. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/04-/347/225/214/351/235/242-/344/272/244/344/272/222.md +432 -0
  16. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/05-/347/225/214/351/235/242-/350/276/223/345/205/245.md +42 -0
  17. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/06-/347/275/221/347/273/234.md +148 -0
  18. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/07-/345/252/222/344/275/223.md +346 -0
  19. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/08-/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 +546 -0
  20. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/09-/350/256/276/345/244/207-/350/223/235/347/211/231.md +961 -0
  21. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/10-/350/256/276/345/244/207-wi-fi.md +277 -0
  22. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/11-/350/256/276/345/244/207-/345/212/240/351/200/237/345/272/246/350/256/241.md +104 -0
  23. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/12-/350/256/276/345/244/207-ibeacon.md +148 -0
  24. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/13-/350/256/276/345/244/207-/347/275/227/347/233/230.md +82 -0
  25. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/14-/350/256/276/345/244/207-/350/256/276/345/244/207/346/226/271/345/220/221.md +70 -0
  26. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/15-/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md +104 -0
  27. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/16-ui-/350/276/223/345/205/245.md +65 -0
  28. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/17-/350/256/276/345/244/207-/347/275/221/347/273/234.md +164 -0
  29. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/18-/350/256/276/345/244/207-/347/237/255/344/277/241.md +62 -0
  30. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/19-/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md +43 -0
  31. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/20-/350/256/276/345/244/207-/347/224/265/346/261/240.md +83 -0
  32. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/21-/350/256/276/345/244/207-/346/227/245/345/216/206.md +215 -0
  33. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/22-/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md +70 -0
  34. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/23-/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md +270 -0
  35. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/24-/350/256/276/345/244/207-/345/212/240/345/257/206.md +56 -0
  36. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/25-/350/256/276/345/244/207-/347/224/265/350/257/235.md +41 -0
  37. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/26-/350/256/276/345/244/207-/346/211/253/347/240/201.md +100 -0
  38. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/27-/350/256/276/345/244/207-/345/261/217/345/271/225.md +173 -0
  39. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/28-/350/256/276/345/244/207-/351/234/207/345/212/250.md +66 -0
  40. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api/README.md +36 -0
  41. package/dist/contexts/doubao-apps-dev/.ai/reference/open-api.md +326 -0
  42. package/dist/contexts/doubao-apps-dev/.ai/rules/dos-and-donts.md +390 -0
  43. package/dist/{skills → contexts}/doubao-apps-dev/AGENTS.md +56 -33
  44. package/dist/{skills → contexts}/doubao-apps-dev/CLAUDE.md +1 -1
  45. package/dist/manifest.json +45 -0
  46. package/dist/skills/doubao-apps-dev/.ai/examples/common-patterns.md +53 -43
  47. package/dist/skills/doubao-apps-dev/.ai/examples/component-basics.md +0 -17
  48. package/dist/skills/doubao-apps-dev/.ai/guides/component-development.md +96 -214
  49. package/dist/skills/doubao-apps-dev/.ai/guides/system-prompt.md +14 -14
  50. package/dist/skills/doubao-apps-dev/.ai/reference/framework-api-quick-ref.md +46 -85
  51. package/dist/skills/doubao-apps-dev/.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
  52. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/02-/345/255/230/345/202/250.md +409 -0
  53. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/03-/350/267/257/347/224/261.md +165 -0
  54. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/04-/347/225/214/351/235/242-/344/272/244/344/272/222.md +432 -0
  55. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/05-/347/225/214/351/235/242-/350/276/223/345/205/245.md +42 -0
  56. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/06-/347/275/221/347/273/234.md +148 -0
  57. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/07-/345/252/222/344/275/223.md +346 -0
  58. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/08-/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 +546 -0
  59. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/09-/350/256/276/345/244/207-/350/223/235/347/211/231.md +961 -0
  60. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/10-/350/256/276/345/244/207-wi-fi.md +277 -0
  61. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/11-/350/256/276/345/244/207-/345/212/240/351/200/237/345/272/246/350/256/241.md +104 -0
  62. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/12-/350/256/276/345/244/207-ibeacon.md +148 -0
  63. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/13-/350/256/276/345/244/207-/347/275/227/347/233/230.md +82 -0
  64. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/14-/350/256/276/345/244/207-/350/256/276/345/244/207/346/226/271/345/220/221.md +70 -0
  65. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/15-/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md +104 -0
  66. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/16-ui-/350/276/223/345/205/245.md +65 -0
  67. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/17-/350/256/276/345/244/207-/347/275/221/347/273/234.md +164 -0
  68. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/18-/350/256/276/345/244/207-/347/237/255/344/277/241.md +62 -0
  69. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/19-/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md +43 -0
  70. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/20-/350/256/276/345/244/207-/347/224/265/346/261/240.md +83 -0
  71. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/21-/350/256/276/345/244/207-/346/227/245/345/216/206.md +215 -0
  72. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/22-/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md +70 -0
  73. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/23-/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md +270 -0
  74. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/24-/350/256/276/345/244/207-/345/212/240/345/257/206.md +56 -0
  75. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/25-/350/256/276/345/244/207-/347/224/265/350/257/235.md +41 -0
  76. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/26-/350/256/276/345/244/207-/346/211/253/347/240/201.md +100 -0
  77. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/27-/350/256/276/345/244/207-/345/261/217/345/271/225.md +173 -0
  78. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/28-/350/256/276/345/244/207-/351/234/207/345/212/250.md +66 -0
  79. package/dist/skills/doubao-apps-dev/.ai/reference/open-api/README.md +36 -0
  80. package/dist/skills/doubao-apps-dev/.ai/reference/open-api.md +267 -4542
  81. package/dist/skills/doubao-apps-dev/.ai/rules/dos-and-donts.md +50 -37
  82. package/dist/skills/doubao-apps-dev/SKILL.md +57 -29
  83. package/dist/skills/douyin-to-doubao/SKILL.md +2 -2
  84. package/dist/skills/h5-to-doubao/SKILL.md +2 -2
  85. package/dist/skills/uniapp-to-doubao/SKILL.md +2 -2
  86. package/dist/skills/weixin-to-doubao/SKILL.md +2 -2
  87. package/package.json +4 -2
@@ -1,4601 +1,326 @@
1
- **@byted-doubao-apps/open-api** **Docs**
1
+ # Open API
2
2
 
3
- ***
3
+ > 公开可用的端能力 API。默认从 `@doubao-apps/framework/api` 导入;本文件根据 `packages/open-api/src` 的导出结构自动生成,按模块列出 API 名称和说明。
4
4
 
5
- # @byted-doubao-apps/open-api
5
+ 覆盖 119 个函数。详细参数、返回值、示例和相关类型请查看 [Open API 目录](open-api/README.md),精确字段也可按参数/结果类型名查看 IDE 类型提示或 `@doubao-apps/framework/api` 类型定义。
6
6
 
7
- ## Functions
8
-
9
- ### addPhoneCalendar()
10
-
11
- > **addPhoneCalendar**(`params`): `Promise`\<`object`\>
12
-
13
- 向系统日历添加事件。
14
-
15
- #### Parameters
16
-
17
- • **params**: [`AddPhoneCalendarParams`](doubao-apps-sdk-open-api.md#addphonecalendarparams)
18
-
19
- #### Returns
20
-
21
- `Promise`\<`object`\>
22
-
23
- ***
24
-
25
- ### addPhoneContact()
26
-
27
- > **addPhoneContact**(`params`): `Promise`\<`object`\>
28
-
29
- 添加手机联系人。
30
-
31
- #### Parameters
32
-
33
- • **params**: [`AddPhoneContactParams`](doubao-apps-sdk-open-api.md#addphonecontactparams)
34
-
35
- #### Returns
36
-
37
- `Promise`\<`object`\>
38
-
39
- ***
40
-
41
- ### addPhoneRepeatCalendar()
42
-
43
- > **addPhoneRepeatCalendar**(`params`): `Promise`\<`object`\>
44
-
45
- 向系统日历添加重复事件。
46
-
47
- #### Parameters
48
-
49
- • **params**: [`AddPhoneRepeatCalendarParams`](doubao-apps-sdk-open-api.md#addphonerepeatcalendarparams)
50
-
51
- #### Returns
52
-
53
- `Promise`\<`object`\>
54
-
55
- ***
56
-
57
- ### authorize()
58
-
59
- > **authorize**(`params`): `Promise`\<`object`\>
60
-
61
- 初始化授权
62
-
63
- #### Parameters
64
-
65
- • **params**: [`AuthorizeRequest`](doubao-apps-sdk-open-api.md#authorizerequest)
66
-
67
- 授权参数
68
-
69
- #### Returns
70
-
71
- `Promise`\<`object`\>
72
-
73
- Promise 对象,授权成功时会返回授权结果
74
-
75
- ***
76
-
77
- ### canIUse()
78
-
79
- > **canIUse**(`params`): `Promise`\<[`CanIUseResult`](doubao-apps-sdk-open-api.md#caniuseresult)\>
80
-
81
- #### Parameters
82
-
83
- • **params**: [`CanIUseParams`](doubao-apps-sdk-open-api.md#caniuseparams)
84
-
85
- #### Returns
86
-
87
- `Promise`\<[`CanIUseResult`](doubao-apps-sdk-open-api.md#caniuseresult)\>
88
-
89
- ***
90
-
91
- ### checkIsOpenAccessibility()
92
-
93
- > **checkIsOpenAccessibility**(`params`?): `Promise`\<[`CheckIsOpenAccessibilityResult`](doubao-apps-sdk-open-api.md#checkisopenaccessibilityresult)\>
94
-
95
- 检测无障碍能力是否开启。
96
-
97
- #### Parameters
98
-
99
- • **params?**: `Record`\<`string`, `never`\>
100
-
101
- #### Returns
102
-
103
- `Promise`\<[`CheckIsOpenAccessibilityResult`](doubao-apps-sdk-open-api.md#checkisopenaccessibilityresult)\>
104
-
105
- ***
106
-
107
- ### chooseContact()
108
-
109
- > **chooseContact**(`params`?): `Promise`\<[`ChooseContactResult`](doubao-apps-sdk-open-api.md#choosecontactresult)\>
110
-
111
- 选择手机联系人。
112
-
113
- #### Parameters
114
-
115
- • **params?**: `Record`\<`string`, `never`\>
116
-
117
- #### Returns
118
-
119
- `Promise`\<[`ChooseContactResult`](doubao-apps-sdk-open-api.md#choosecontactresult)\>
120
-
121
- ***
122
-
123
- ### clearStorage()
124
-
125
- > **clearStorage**(`params`?): `Promise`\<`object`\>
126
-
127
- 清空本地缓存。
128
-
129
- #### Parameters
130
-
131
- • **params?**: `object`
132
-
133
- #### Returns
134
-
135
- `Promise`\<`object`\>
136
-
137
- 返回一个 Promise,清空完成后 resolve。
138
-
139
- #### Example
140
-
141
- ```typescript
142
- import { clearStorage } from '@doubao-apps/framework/api';
143
-
144
- await clearStorage();
145
- ```
146
-
147
- ***
148
-
149
- ### clearStorageSync()
150
-
151
- > **clearStorageSync**(`params`?): `object`
152
-
153
- 清空本地缓存。
154
-
155
- #### Parameters
156
-
157
- • **params?**: `object`
158
-
159
- #### Returns
160
-
161
- `object`
162
-
163
- 同步清空完成后返回。
164
-
165
- #### Example
166
-
167
- ```typescript
168
- import { clearStorageSync } from '@doubao-apps/framework/api';
169
-
170
- clearStorageSync();
171
- ```
172
-
173
- ***
174
-
175
- ### ~~close()~~
176
-
177
- > **close**(`params`?): `Promise`\<`object`\>
178
-
179
- 关闭栈顶页面。
180
-
181
- #### Parameters
182
-
183
- • **params?**: [`CloseParams`](doubao-apps-sdk-open-api.md#closeparams)
184
-
185
- #### Returns
186
-
187
- `Promise`\<`object`\>
188
-
189
- 返回一个 Promise,在关闭操作成功发起时解析
190
-
191
- #### Deprecated
192
-
193
- 使用 [navigateBack](doubao-apps-sdk-open-api.md#navigateback)
194
-
195
- #### Example
196
-
197
- ```typescript
198
- import { close } from '@doubao-apps/framework/api';
199
-
200
- async function closeTopPage() {
201
- try {
202
- await close();
203
- } catch (e) {
204
- console.error('关闭页面失败', e);
205
- }
206
- }
207
-
208
- closePage();
209
- ```
210
-
211
- ***
212
-
213
- ### closeBLEConnection()
214
-
215
- > **closeBLEConnection**(`params`): `Promise`\<`object`\>
216
-
217
- 关闭 BLE 连接。
218
-
219
- #### Parameters
220
-
221
- • **params**: [`CloseBLEConnectionParams`](doubao-apps-sdk-open-api.md#closebleconnectionparams)
222
-
223
- #### Returns
224
-
225
- `Promise`\<`object`\>
226
-
227
- ***
228
-
229
- ### closeBluetoothAdapter()
230
-
231
- > **closeBluetoothAdapter**(`params`?): `Promise`\<`object`\>
232
-
233
- 关闭蓝牙适配器。
234
-
235
- #### Parameters
236
-
237
- • **params?**: `Record`\<`string`, `never`\>
238
-
239
- #### Returns
240
-
241
- `Promise`\<`object`\>
242
-
243
- ***
244
-
245
- ### connectWifi()
246
-
247
- > **connectWifi**(`params`): `Promise`\<`object`\>
248
-
249
- 连接指定 Wi-Fi。
250
-
251
- #### Parameters
252
-
253
- • **params**: [`ConnectWifiParams`](doubao-apps-sdk-open-api.md#connectwifiparams)
254
-
255
- #### Returns
256
-
257
- `Promise`\<`object`\>
258
-
259
- ***
260
-
261
- ### createBLEConnection()
262
-
263
- > **createBLEConnection**(`params`): `Promise`\<`object`\>
264
-
265
- 创建 BLE 连接。
266
-
267
- #### Parameters
268
-
269
- • **params**: [`CreateBLEConnectionParams`](doubao-apps-sdk-open-api.md#createbleconnectionparams)
270
-
271
- #### Returns
272
-
273
- `Promise`\<`object`\>
274
-
275
- ***
276
-
277
- ### exitApp()
278
-
279
- > **exitApp**(): `Promise`\<`object`\>
280
-
281
- 退去当前所有页面
282
-
283
- #### Returns
284
-
285
- `Promise`\<`object`\>
286
-
287
- ***
288
-
289
- ### getAccountInfo()
290
-
291
- > **getAccountInfo**(`params`?): `Promise`\<[`GetAccountInfoResult`](doubao-apps-sdk-open-api.md#getaccountinforesult)\>
292
-
293
- 异步获取账号信息。
294
-
295
- #### Parameters
296
-
297
- • **params?**
298
-
299
- #### Returns
300
-
301
- `Promise`\<[`GetAccountInfoResult`](doubao-apps-sdk-open-api.md#getaccountinforesult)\>
302
-
303
- #### Example
304
-
305
- ```typescript
306
- import { getAccountInfo } from '@doubao-apps/framework/api';
307
-
308
- const result = await getAccountInfo();
309
- console.log(result.miniProgram.appId);
310
- ```
311
-
312
- ***
313
-
314
- ### getAccountInfoSync()
315
-
316
- > **getAccountInfoSync**(`params`?): [`GetAccountInfoResult`](doubao-apps-sdk-open-api.md#getaccountinforesult)
317
-
318
- 同步获取账号信息。
319
-
320
- #### Parameters
321
-
322
- • **params?**
323
-
324
- #### Returns
325
-
326
- [`GetAccountInfoResult`](doubao-apps-sdk-open-api.md#getaccountinforesult)
327
-
328
- #### Example
329
-
330
- ```typescript
331
- import { getAccountInfoSync } from '@doubao-apps/framework/api';
332
-
333
- const result = getAccountInfoSync();
334
- console.log(result.miniProgram.appId, result.miniProgram.envVersion, result.miniProgram.version);
335
- ```
336
-
337
- ***
338
-
339
- ### getAppBaseInfo()
340
-
341
- > **getAppBaseInfo**(`params`?): `Promise`\<[`GetAppBaseInfoResult`](doubao-apps-sdk-open-api.md#getappbaseinforesult)\>
342
-
343
- 获取应用基础信息。
344
-
345
- #### Parameters
346
-
347
- • **params?**
348
-
349
- #### Returns
350
-
351
- `Promise`\<[`GetAppBaseInfoResult`](doubao-apps-sdk-open-api.md#getappbaseinforesult)\>
352
-
353
- 返回 SDK 版本、调试开关、宿主信息、语言和主题等字段,见 [GetAppBaseInfoResult](doubao-apps-sdk-open-api.md#getappbaseinforesult)。
354
-
355
- #### Example
356
-
357
- ```typescript
358
- import { getAppBaseInfo } from '@doubao-apps/framework/api';
359
-
360
- const result = await getAppBaseInfo();
361
-
362
- console.log(result.language, result.SDKVersion, result.theme);
363
- console.log(result.host?.appId, result.enableDebug);
364
- ```
365
-
366
- ***
367
-
368
- ### getAppBaseInfoSync()
369
-
370
- > **getAppBaseInfoSync**(`_params`?): [`GetAppBaseInfoResult`](doubao-apps-sdk-open-api.md#getappbaseinforesult)
371
-
372
- 获取应用基础信息。
373
-
374
- #### Parameters
375
-
376
- • **\_params?**
377
-
378
- #### Returns
379
-
380
- [`GetAppBaseInfoResult`](doubao-apps-sdk-open-api.md#getappbaseinforesult)
381
-
382
- 返回 SDK 版本、调试开关、宿主信息、语言和主题等字段,见 [GetAppBaseInfoResult](doubao-apps-sdk-open-api.md#getappbaseinforesult)。
383
-
384
- #### Example
7
+ ## 使用方式
385
8
 
386
9
  ```typescript
387
- import { getAppBaseInfoSync } from '@doubao-apps/framework/api';
388
-
389
- const result = getAppBaseInfoSync();
390
-
391
- console.log(result.language, result.SDKVersion, result.theme);
392
- console.log(result.host?.appId, result.enableDebug);
10
+ import { showToast, request, getStorage } from '@doubao-apps/framework/api';
393
11
  ```
394
12
 
395
- ***
13
+ ## 基础 / 账号 / 系统
14
+
15
+ 账号、授权、宿主基础信息、窗口信息和定位。
16
+
17
+ | API | 说明 |
18
+ | --- | --- |
19
+ | [getAccountInfo](open-api/01-基础-账号-系统.md#getaccountinfo) | 异步获取账号信息。 |
20
+ | [getAccountInfoSync](open-api/01-基础-账号-系统.md#getaccountinfosync) | 同步获取账号信息。<br><br>同步 API。 |
21
+ | [authorize](open-api/01-基础-账号-系统.md#authorize) | 初始化授权。<br><br>按 scope 申请授权。 |
22
+ | [canIUse](open-api/01-基础-账号-系统.md#caniuse) | 检测当前宿主是否支持指定 API 或能力。<br><br>用于兼容性判断。 |
23
+ | [getLocation](open-api/01-基础-账号-系统.md#getlocation) | 获取设备当前的地理位置信息。<br><br>可能涉及定位授权。 |
24
+ | [login](open-api/01-基础-账号-系统.md#login) | 发起登录并获取登录凭证。 |
25
+ | [getWindowInfoSync](open-api/01-基础-账号-系统.md#getwindowinfosync) | 获取窗口信息。<br><br>同步 API。 |
26
+ | [getSystemSetting](open-api/01-基础-账号-系统.md#getsystemsetting) | 获取设备设置。 |
27
+ | [getAppBaseInfoSync](open-api/01-基础-账号-系统.md#getappbaseinfosync) | 获取应用基础信息。<br><br>同步 API。 |
28
+ | [getWindowInfo](open-api/01-基础-账号-系统.md#getwindowinfo) | 获取窗口信息。 |
29
+ | [getAppBaseInfo](open-api/01-基础-账号-系统.md#getappbaseinfo) | 获取应用基础信息。 |
30
+
31
+ ## 存储
32
+
33
+ 本地缓存;带 Sync 后缀的是同步 API。
34
+
35
+ | API | 说明 |
36
+ | --- | --- |
37
+ | [setStorage](open-api/02-存储.md#setstorage) | 将数据写入本地缓存。 |
38
+ | [setStorageSync](open-api/02-存储.md#setstoragesync) | 将数据写入本地缓存。<br><br>同步 API。 |
39
+ | [getStorage](open-api/02-存储.md#getstorage) | 从本地缓存读取数据。 |
40
+ | [getStorageSync](open-api/02-存储.md#getstoragesync) | 从本地缓存同步读取数据。<br><br>同步 API。 |
41
+ | [removeStorage](open-api/02-存储.md#removestorage) | 删除本地缓存中指定 key 的数据。 |
42
+ | [removeStorageSync](open-api/02-存储.md#removestoragesync) | 删除本地缓存中指定 key 的数据。<br><br>同步 API。 |
43
+ | [clearStorage](open-api/02-存储.md#clearstorage) | 清空本地缓存。 |
44
+ | [clearStorageSync](open-api/02-存储.md#clearstoragesync) | 清空本地缓存。<br><br>同步 API。 |
45
+ | [getStorageInfo](open-api/02-存储.md#getstorageinfo) | 获取本地缓存信息。 |
46
+ | [getStorageInfoSync](open-api/02-存储.md#getstorageinfosync) | 同步获取本地缓存信息。<br><br>同步 API。 |
47
+
48
+ ## 路由
49
+
50
+ 应用内页面跳转和关闭。
51
+
52
+ | API | 说明 |
53
+ | --- | --- |
54
+ | [close](open-api/03-路由.md#close) | 关闭栈顶页面。<br><br>已废弃,使用 navigateBack。 |
55
+ | [navigateTo](open-api/03-路由.md#navigateto) | 保留当前页面,跳转到应用内的某个页面。 |
56
+ | [redirectTo](open-api/03-路由.md#redirectto) | 关闭当前页面,跳转到应用内的某个页面。 |
57
+ | [reLaunch](open-api/03-路由.md#relaunch) | 关闭所有页面并跳转到应用内页面。 |
58
+ | [navigateBack](open-api/03-路由.md#navigateback) | 关闭当前页面,返回上一页面或多级页面。 |
59
+ | [exitApp](open-api/03-路由.md#exitapp) | 退出当前所有页面。<br><br>会退出当前所有页面。 |
60
+
61
+ ## 界面 / 交互
62
+
63
+ Toast、Loading、Modal、ActionSheet 和返回前提醒。
64
+
65
+ | API | 说明 |
66
+ | --- | --- |
67
+ | [showModal](open-api/04-界面-交互.md#showmodal) | 显示模态对话框。 |
68
+ | [showLoading](open-api/04-界面-交互.md#showloading) | 显示 loading 提示框。<br><br>需调用 hideLoading 关闭。 |
69
+ | [hideToast](open-api/04-界面-交互.md#hidetoast) | 隐藏当前 Toast。 |
70
+ | [hideLoading](open-api/04-界面-交互.md#hideloading) | 隐藏当前 loading。 |
71
+ | [showActionSheet](open-api/04-界面-交互.md#showactionsheet) | 显示操作菜单。 |
72
+ | [getMenuButtonBoundingClientRect](open-api/04-界面-交互.md#getmenubuttonboundingclientrect) | 获取菜单按钮的布局位置信息。 |
73
+ | [enableAlertBeforeUnload](open-api/04-界面-交互.md#enablealertbeforeunload) | 开启页面返回前提醒。<br><br>配合 disableAlertBeforeUnload 使用。 |
74
+ | [disableAlertBeforeUnload](open-api/04-界面-交互.md#disablealertbeforeunload) | 关闭页面返回前提醒。 |
75
+ | [showToast](open-api/04-界面-交互.md#showtoast) | 显示 Toast 提示。<br><br>duration 和 icon 可控制提示表现。 |
76
+
77
+ ## 界面 / 输入
78
+
79
+ 键盘和输入框选区能力。
80
+
81
+ | API | 说明 |
82
+ | --- | --- |
83
+ | [onKeyboardHeightChange](open-api/05-界面-输入.md#onkeyboardheightchange) | 监听键盘高度变化事件。<br><br>返回取消监听函数。 |
84
+
85
+ ## 网络
86
+
87
+ 网络请求
88
+
89
+ | API | 说明 |
90
+ | --- | --- |
91
+ | [request](open-api/06-网络.md#request) | 发起网络请求。<br><br>返回 statusCode、header 和 data。 |
92
+
93
+ ## 媒体
94
+
95
+ 图片选择、预览、保存、压缩和信息读取。
96
+
97
+ | API | 说明 |
98
+ | --- | --- |
99
+ | [saveImageToPhotosAlbum](open-api/07-媒体.md#saveimagetophotosalbum) | 保存图片到系统相册。 |
100
+ | [previewImage](open-api/07-媒体.md#previewimage) | 预览图片。 |
101
+ | [getImageInfo](open-api/07-媒体.md#getimageinfo) | 获取图片信息。 |
102
+ | [chooseImage](open-api/07-媒体.md#chooseimage) | 选择图片。 |
103
+ | [compressImage](open-api/07-媒体.md#compressimage) | 压缩图片。 |
104
+
105
+ ## 开放能力 / 业务能力
106
+
107
+ 开放业务能力、支付、隐私设置、上下文和外部应用打开。
108
+
109
+ | API | 说明 |
110
+ | --- | --- |
111
+ | [getOrderPayment](open-api/08-开放能力-业务能力.md#getorderpayment) | 查询订单支付结果。 |
112
+ | [postLoginResult](open-api/08-开放能力-业务能力.md#postloginresult) | 回传 MCP 授权登录凭证。 |
113
+ | [getPrivacySetting](open-api/08-开放能力-业务能力.md#getprivacysetting) | 获取隐私设置状态。 |
114
+ | [requestOrder](open-api/08-开放能力-业务能力.md#requestorder) | 发起订单支付流程。 |
115
+ | [loginWithDoubaoWidget](open-api/08-开放能力-业务能力.md#loginwithdoubaowidget) | 发起豆包 Widget 登录。 |
116
+ | [sendQueryMessage](open-api/08-开放能力-业务能力.md#sendquerymessage) | 以用户身份发送一条消息。<br><br>返回 void,不是 Promise。 |
117
+ | [updateModelContext](open-api/08-开放能力-业务能力.md#updatemodelcontext) | 向 Agent 捐赠上下文。 |
118
+ | [setAdditionalContext](open-api/08-开放能力-业务能力.md#setadditionalcontext) | 设置全局上下文供大模型理解。<br><br>设置全局上下文。 |
119
+ | [dispatchActionDirective](open-api/08-开放能力-业务能力.md#dispatchactiondirective) | 描述用户行为,约束模型行为及指定执行路径。 |
120
+ | [updateWidget](open-api/08-开放能力-业务能力.md#updatewidget) | 更新指定卡片。 |
121
+ | [expiredWidget](open-api/08-开放能力-业务能力.md#expiredwidget) | 更新过期的 widget 为固定卡片。 |
122
+ | [openApp](open-api/08-开放能力-业务能力.md#openapp) | 通过 deep link 等方式打开外部应用。 |
123
+
124
+ ## 设备 / 蓝牙
125
+
126
+ 蓝牙和 BLE 能力;通常先打开适配器,再扫描、连接和读写。
127
+
128
+ | API | 说明 |
129
+ | --- | --- |
130
+ | [openBluetoothAdapter](open-api/09-设备-蓝牙.md#openbluetoothadapter) | 打开蓝牙适配器。<br><br>蓝牙流程入口。 |
131
+ | [startBluetoothDevicesDiscovery](open-api/09-设备-蓝牙.md#startbluetoothdevicesdiscovery) | 开始搜索附近的蓝牙设备。<br><br>通常先调用 openBluetoothAdapter。 |
132
+ | [stopBluetoothDevicesDiscovery](open-api/09-设备-蓝牙.md#stopbluetoothdevicesdiscovery) | 停止搜索附近的蓝牙设备。 |
133
+ | [getBluetoothAdapterState](open-api/09-设备-蓝牙.md#getbluetoothadapterstate) | 获取蓝牙适配器状态。 |
134
+ | [getBluetoothDevices](open-api/09-设备-蓝牙.md#getbluetoothdevices) | 获取当前蓝牙模块发现的设备列表。<br><br>通常先调用 startBluetoothDevicesDiscovery。 |
135
+ | [getConnectedBluetoothDevices](open-api/09-设备-蓝牙.md#getconnectedbluetoothdevices) | 获取已连接的蓝牙设备列表。 |
136
+ | [makeBluetoothPair](open-api/09-设备-蓝牙.md#makebluetoothpair) | 发起蓝牙配对。 |
137
+ | [isBluetoothDevicePaired](open-api/09-设备-蓝牙.md#isbluetoothdevicepaired) | 查询蓝牙设备是否已经配对。 |
138
+ | [closeBluetoothAdapter](open-api/09-设备-蓝牙.md#closebluetoothadapter) | 关闭蓝牙适配器。<br><br>会关闭蓝牙模块。 |
139
+ | [createBLEConnection](open-api/09-设备-蓝牙.md#createbleconnection) | 创建 BLE 连接。<br><br>需要传入 deviceId。 |
140
+ | [closeBLEConnection](open-api/09-设备-蓝牙.md#closebleconnection) | 关闭 BLE 连接。 |
141
+ | [getBLEDeviceServices](open-api/09-设备-蓝牙.md#getbledeviceservices) | 获取 BLE 服务列表。<br><br>通常先调用 createBLEConnection。 |
142
+ | [getBLEDeviceCharacteristics](open-api/09-设备-蓝牙.md#getbledevicecharacteristics) | 获取 BLE 特征值列表。<br><br>通常先获取 BLE 服务列表。 |
143
+ | [getBLEDeviceRSSI](open-api/09-设备-蓝牙.md#getbledevicerssi) | 获取 BLE 设备 RSSI。 |
144
+ | [getBLEMTU](open-api/09-设备-蓝牙.md#getblemtu) | 获取 BLE MTU。 |
145
+ | [notifyBLECharacteristicValueChange](open-api/09-设备-蓝牙.md#notifyblecharacteristicvaluechange) | 订阅 BLE 特征值变化。<br><br>订阅指定特征值变化。 |
146
+ | [readBLECharacteristicValue](open-api/09-设备-蓝牙.md#readblecharacteristicvalue) | 读取 BLE 特征值。<br><br>需要传入 serviceId 和 characteristicId。 |
147
+ | [setBLEMTU](open-api/09-设备-蓝牙.md#setblemtu) | 设置 BLE MTU。 |
148
+ | [writeBLECharacteristicValue](open-api/09-设备-蓝牙.md#writeblecharacteristicvalue) | 写入 BLE 特征值。<br><br>value 需要是 ArrayBuffer。 |
396
149
 
397
- ### getBLEDeviceCharacteristics()
150
+ ## 设备 / Wi-Fi
398
151
 
399
- > **getBLEDeviceCharacteristics**(`params`): `Promise`\<[`GetBLEDeviceCharacteristicsResult`](doubao-apps-sdk-open-api.md#getbledevicecharacteristicsresult)\>
152
+ Wi-Fi 模块能力;通常先 startWifi,再获取列表或连接。
153
+
154
+ | API | 说明 |
155
+ | --- | --- |
156
+ | [startWifi](open-api/10-设备-wi-fi.md#startwifi) | 初始化 Wi-Fi 模块。<br><br>Wi-Fi 流程入口。 |
157
+ | [stopWifi](open-api/10-设备-wi-fi.md#stopwifi) | 关闭 Wi-Fi 模块。 |
158
+ | [setWifiList](open-api/10-设备-wi-fi.md#setwifilist) | 设置 Wi-Fi 预设列表。<br><br>用于预设 Wi-Fi 列表。 |
159
+ | [connectWifi](open-api/10-设备-wi-fi.md#connectwifi) | 连接指定 Wi-Fi。<br><br>通常先调用 startWifi。 |
160
+ | [getConnectedWifi](open-api/10-设备-wi-fi.md#getconnectedwifi) | 获取当前已连接 Wi-Fi 信息。 |
161
+ | [getWifiList](open-api/10-设备-wi-fi.md#getwifilist) | 获取 Wi-Fi 列表。<br><br>通常先调用 startWifi。 |
400
162
 
401
- 获取 BLE 特征值列表。
163
+ ## 设备 / 加速度计
402
164
 
403
- #### Parameters
165
+ 加速度计监听能力。
404
166
 
405
- **params**: [`GetBLEDeviceCharacteristicsParams`](doubao-apps-sdk-open-api.md#getbledevicecharacteristicsparams)
167
+ | API | 说明 |
168
+ | --- | --- |
169
+ | [startAccelerometer](open-api/11-设备-加速度计.md#startaccelerometer) | 开始监听加速度。<br><br>需配对调用 stopAccelerometer。 |
170
+ | [stopAccelerometer](open-api/11-设备-加速度计.md#stopaccelerometer) | 停止监听加速度。 |
171
+ | [onAccelerometerChange](open-api/11-设备-加速度计.md#onaccelerometerchange) | 监听加速度数据变化事件。<br><br>返回取消监听函数。 |
406
172
 
407
- #### Returns
173
+ ## 设备 / iBeacon
408
174
 
409
- `Promise`\<[`GetBLEDeviceCharacteristicsResult`](doubao-apps-sdk-open-api.md#getbledevicecharacteristicsresult)\>
175
+ iBeacon 搜索和结果读取能力。
410
176
 
411
- ***
177
+ | API | 说明 |
178
+ | --- | --- |
179
+ | [startBeaconDiscovery](open-api/12-设备-ibeacon.md#startbeacondiscovery) | 开始搜索附近的 iBeacon。<br><br>需配对调用 stopBeaconDiscovery。 |
180
+ | [stopBeaconDiscovery](open-api/12-设备-ibeacon.md#stopbeacondiscovery) | 停止搜索附近的 iBeacon。 |
181
+ | [getBeacons](open-api/12-设备-ibeacon.md#getbeacons) | 获取已搜索到的 iBeacon 列表。 |
412
182
 
413
- ### getBLEDeviceRSSI()
183
+ ## 设备 / 罗盘
414
184
 
415
- > **getBLEDeviceRSSI**(`params`): `Promise`\<[`GetBLEDeviceRSSIResult`](doubao-apps-sdk-open-api.md#getbledevicerssiresult)\>
185
+ 罗盘监听能力。
416
186
 
417
- 获取 BLE 设备 RSSI。
187
+ | API | 说明 |
188
+ | --- | --- |
189
+ | [startCompass](open-api/13-设备-罗盘.md#startcompass) | 开始监听罗盘。<br><br>需配对调用 stopCompass。 |
190
+ | [stopCompass](open-api/13-设备-罗盘.md#stopcompass) | 停止监听罗盘。 |
191
+ | [onCompassChange](open-api/13-设备-罗盘.md#oncompasschange) | 监听罗盘数据变化事件。<br><br>返回取消监听函数。 |
418
192
 
419
- #### Parameters
193
+ ## 设备 / 设备方向
420
194
 
421
- • **params**: [`GetBLEDeviceRSSIParams`](doubao-apps-sdk-open-api.md#getbledevicerssiparams)
195
+ 设备方向监听能力。
196
+
197
+ | API | 说明 |
198
+ | --- | --- |
199
+ | [startDeviceMotionListening](open-api/14-设备-设备方向.md#startdevicemotionlistening) | 开始监听设备方向变化。<br><br>需配对调用 stopDeviceMotionListening。 |
200
+ | [stopDeviceMotionListening](open-api/14-设备-设备方向.md#stopdevicemotionlistening) | 停止监听设备方向变化。 |
201
+
202
+ ## 设备 / 陀螺仪
422
203
 
423
- #### Returns
204
+ 陀螺仪监听能力。
205
+
206
+ | API | 说明 |
207
+ | --- | --- |
208
+ | [startGyroscope](open-api/15-设备-陀螺仪.md#startgyroscope) | 开始监听陀螺仪。<br><br>需配对调用 stopGyroscope。 |
209
+ | [stopGyroscope](open-api/15-设备-陀螺仪.md#stopgyroscope) | 停止监听陀螺仪。 |
210
+ | [onGyroscopeChange](open-api/15-设备-陀螺仪.md#ongyroscopechange) | 监听陀螺仪数据变化事件。<br><br>返回取消监听函数。 |
211
+
212
+ ## UI / 输入
213
+
214
+ 键盘和输入框选区能力。
424
215
 
425
- `Promise`\<[`GetBLEDeviceRSSIResult`](doubao-apps-sdk-open-api.md#getbledevicerssiresult)\>
216
+ | API | 说明 |
217
+ | --- | --- |
218
+ | [hideKeyboard](open-api/16-ui-输入.md#hidekeyboard) | 收起键盘。 |
219
+ | [getSelectedTextRange](open-api/16-ui-输入.md#getselectedtextrange) | 获取当前输入框的选区范围。 |
426
220
 
427
- ***
221
+ ## 设备 / 网络
428
222
 
429
- ### getBLEDeviceServices()
223
+ 网络类型和本机局域网 IP。
430
224
 
431
- > **getBLEDeviceServices**(`params`): `Promise`\<[`GetBLEDeviceServicesResult`](doubao-apps-sdk-open-api.md#getbledeviceservicesresult)\>
225
+ | API | 说明 |
226
+ | --- | --- |
227
+ | [getLocalIPAddress](open-api/17-设备-网络.md#getlocalipaddress) | 获取局域网 IP 地址。 |
228
+ | [getNetworkType](open-api/17-设备-网络.md#getnetworktype) | 获取当前网络类型。 |
229
+ | [onNetworkStatusChange](open-api/17-设备-网络.md#onnetworkstatuschange) | 监听网络状态变化事件。<br><br>返回取消监听函数。 |
432
230
 
433
- 获取 BLE 服务列表。
231
+ ## 设备 / 短信
434
232
 
435
- #### Parameters
436
-
437
- • **params**: [`GetBLEDeviceServicesParams`](doubao-apps-sdk-open-api.md#getbledeviceservicesparams)
438
-
439
- #### Returns
440
-
441
- `Promise`\<[`GetBLEDeviceServicesResult`](doubao-apps-sdk-open-api.md#getbledeviceservicesresult)\>
442
-
443
- ***
444
-
445
- ### getBLEMTU()
446
-
447
- > **getBLEMTU**(`params`): `Promise`\<[`GetBLEMTUResult`](doubao-apps-sdk-open-api.md#getblemturesult)\>
448
-
449
- 获取 BLE MTU。
450
-
451
- #### Parameters
452
-
453
- • **params**: [`GetBLEMTUParams`](doubao-apps-sdk-open-api.md#getblemtuparams)
454
-
455
- #### Returns
456
-
457
- `Promise`\<[`GetBLEMTUResult`](doubao-apps-sdk-open-api.md#getblemturesult)\>
458
-
459
- ***
460
-
461
- ### getBatteryInfo()
462
-
463
- > **getBatteryInfo**(`params`?): `Promise`\<[`GetBatteryInfoResult`](doubao-apps-sdk-open-api.md#getbatteryinforesult)\>
464
-
465
- 获取电池信息。
466
-
467
- #### Parameters
468
-
469
- • **params?**: `Record`\<`string`, `never`\>
470
-
471
- #### Returns
472
-
473
- `Promise`\<[`GetBatteryInfoResult`](doubao-apps-sdk-open-api.md#getbatteryinforesult)\>
474
-
475
- ***
476
-
477
- ### getBeacons()
478
-
479
- > **getBeacons**(`params`?): `Promise`\<[`GetBeaconsResult`](doubao-apps-sdk-open-api.md#getbeaconsresult)\>
480
-
481
- 获取已搜索到的 iBeacon 列表。
482
-
483
- #### Parameters
484
-
485
- • **params?**: `Record`\<`string`, `never`\>
486
-
487
- #### Returns
488
-
489
- `Promise`\<[`GetBeaconsResult`](doubao-apps-sdk-open-api.md#getbeaconsresult)\>
490
-
491
- ***
492
-
493
- ### getBluetoothAdapterState()
494
-
495
- > **getBluetoothAdapterState**(`params`?): `Promise`\<[`GetBluetoothAdapterStateResult`](doubao-apps-sdk-open-api.md#getbluetoothadapterstateresult)\>
496
-
497
- 获取蓝牙适配器状态。
498
-
499
- #### Parameters
500
-
501
- • **params?**: `Record`\<`string`, `never`\>
502
-
503
- #### Returns
504
-
505
- `Promise`\<[`GetBluetoothAdapterStateResult`](doubao-apps-sdk-open-api.md#getbluetoothadapterstateresult)\>
506
-
507
- ***
508
-
509
- ### getBluetoothDevices()
510
-
511
- > **getBluetoothDevices**(`params`?): `Promise`\<[`GetBluetoothDevicesResult`](doubao-apps-sdk-open-api.md#getbluetoothdevicesresult)\>
512
-
513
- 获取当前蓝牙模块发现的设备列表。
514
-
515
- #### Parameters
516
-
517
- • **params?**: `Record`\<`string`, `never`\>
518
-
519
- #### Returns
520
-
521
- `Promise`\<[`GetBluetoothDevicesResult`](doubao-apps-sdk-open-api.md#getbluetoothdevicesresult)\>
522
-
523
- ***
524
-
525
- ### getClipboardData()
526
-
527
- > **getClipboardData**(`params`?): `Promise`\<[`GetClipboardDataResult`](doubao-apps-sdk-open-api.md#getclipboarddataresult)\>
528
-
529
- 获取剪贴板内容。
530
-
531
- #### Parameters
532
-
533
- • **params?**: `Record`\<`string`, `never`\>
534
-
535
- #### Returns
536
-
537
- `Promise`\<[`GetClipboardDataResult`](doubao-apps-sdk-open-api.md#getclipboarddataresult)\>
538
-
539
- ***
540
-
541
- ### getConnectedBluetoothDevices()
542
-
543
- > **getConnectedBluetoothDevices**(`params`): `Promise`\<[`GetConnectedBluetoothDevicesResult`](doubao-apps-sdk-open-api.md#getconnectedbluetoothdevicesresult)\>
544
-
545
- 获取已连接的蓝牙设备列表。
546
-
547
- #### Parameters
548
-
549
- • **params**: [`GetConnectedBluetoothDevicesParams`](doubao-apps-sdk-open-api.md#getconnectedbluetoothdevicesparams)
550
-
551
- #### Returns
552
-
553
- `Promise`\<[`GetConnectedBluetoothDevicesResult`](doubao-apps-sdk-open-api.md#getconnectedbluetoothdevicesresult)\>
554
-
555
- ***
556
-
557
- ### getConnectedWifi()
558
-
559
- > **getConnectedWifi**(`params`?): `Promise`\<[`GetConnectedWifiResult`](doubao-apps-sdk-open-api.md#getconnectedwifiresult)\>
560
-
561
- 获取当前已连接 Wi-Fi 信息。
233
+ 拉起系统短信发送面板。
562
234
 
563
- #### Parameters
235
+ | API | 说明 |
236
+ | --- | --- |
237
+ | [sendSms](open-api/18-设备-短信.md#sendsms) | 拉起系统短信发送面板。 |
564
238
 
565
- **params?**: [`GetConnectedWifiParams`](doubao-apps-sdk-open-api.md#getconnectedwifiparams)
239
+ ## 设备 / 无障碍
566
240
 
567
- #### Returns
241
+ 检测无障碍能力开关状态。
568
242
 
569
- `Promise`\<[`GetConnectedWifiResult`](doubao-apps-sdk-open-api.md#getconnectedwifiresult)\>
243
+ | API | 说明 |
244
+ | --- | --- |
245
+ | [checkIsOpenAccessibility](open-api/19-设备-无障碍.md#checkisopenaccessibility) | 检测无障碍能力是否开启。 |
570
246
 
571
- ***
247
+ ## 设备 / 电池
572
248
 
573
- ### getHCEState()
249
+ 电池信息读取与变化监听。
574
250
 
575
- > **getHCEState**(`params`?): `Promise`\<`object`\>
251
+ | API | 说明 |
252
+ | --- | --- |
253
+ | [getBatteryInfo](open-api/20-设备-电池.md#getbatteryinfo) | 获取电池信息。 |
254
+ | [onBatteryInfoChange](open-api/20-设备-电池.md#onbatteryinfochange) | 监听电池信息变化事件。<br><br>返回取消监听函数。 |
576
255
 
577
- 获取 HCE 状态。
256
+ ## 设备 / 日历
578
257
 
579
- #### Parameters
258
+ 向系统日历添加事件和重复事件。
580
259
 
581
- **params?**: `Record`\<`string`, `never`\>
260
+ | API | 说明 |
261
+ | --- | --- |
262
+ | [addPhoneCalendar](open-api/21-设备-日历.md#addphonecalendar) | 向系统日历添加事件。 |
263
+ | [addPhoneRepeatCalendar](open-api/21-设备-日历.md#addphonerepeatcalendar) | 向系统日历添加重复事件。 |
582
264
 
583
- #### Returns
265
+ ## 设备 / 剪贴板
584
266
 
585
- `Promise`\<`object`\>
267
+ 读取和设置系统剪贴板内容。
586
268
 
587
- ***
269
+ | API | 说明 |
270
+ | --- | --- |
271
+ | [getClipboardData](open-api/22-设备-剪贴板.md#getclipboarddata) | 获取剪贴板内容。 |
272
+ | [setClipboardData](open-api/22-设备-剪贴板.md#setclipboarddata) | 设置系统剪贴板内容。 |
588
273
 
589
- ### getLocalIPAddress()
274
+ ## 设备 / 联系人
590
275
 
591
- > **getLocalIPAddress**(`params`?): `Promise`\<[`GetLocalIPAddressResult`](doubao-apps-sdk-open-api.md#getlocalipaddressresult)\>
276
+ 选择和添加手机联系人。
592
277
 
593
- 获取局域网 IP 地址。
278
+ | API | 说明 |
279
+ | --- | --- |
280
+ | [chooseContact](open-api/23-设备-联系人.md#choosecontact) | 选择手机联系人。 |
281
+ | [addPhoneContact](open-api/23-设备-联系人.md#addphonecontact) | 添加手机联系人。 |
594
282
 
595
- #### Parameters
283
+ ## 设备 / 加密
596
284
 
597
- • **params?**: `Record`\<`string`, `never`\>
285
+ 安全随机数能力。
598
286
 
599
- #### Returns
287
+ | API | 说明 |
288
+ | --- | --- |
289
+ | [getRandomValues](open-api/24-设备-加密.md#getrandomvalues) | 获取安全随机数。 |
600
290
 
601
- `Promise`\<[`GetLocalIPAddressResult`](doubao-apps-sdk-open-api.md#getlocalipaddressresult)\>
602
-
603
- ***
604
-
605
- ### getLocation()
606
-
607
- > **getLocation**(`params`?): `Promise`\<[`GetLocationResponse`](doubao-apps-sdk-open-api.md#getlocationresponse)\>
608
-
609
- 获取设备当前的地理位置信息。
610
-
611
- #### Parameters
612
-
613
- • **params?**: [`GetLocationParams`](doubao-apps-sdk-open-api.md#getlocationparams)
614
-
615
- #### Returns
616
-
617
- `Promise`\<[`GetLocationResponse`](doubao-apps-sdk-open-api.md#getlocationresponse)\>
618
-
619
- 返回一个 Promise,成功时解析为包含地理位置信息的对象,包含:
620
- - `latitude`: number - 纬度。
621
- - `longitude`: number - 经度。
622
- - `timestamp`: string - 时间戳。
623
- - `speed`: number - 行进速度,单位:米/秒。
624
- - `accuracy`: number - 定位精度,单位:米。
625
- 参考 [GetLocationResponse](doubao-apps-sdk-open-api.md#getlocationresponse)。
626
-
627
- #### Throws
628
-
629
- 如果调用失败(例如,用户拒绝权限、定位服务关闭等),则抛出此错误。
630
-
631
- #### Example
632
-
633
- ```typescript
634
- import { getLocation } from '@byted-doubao-apps/framework';
635
-
636
- async function fetchLocation() {
637
- try {
638
- const locationData = await getLocation();
639
- console.log('纬度:', locationData.latitude);
640
- console.log('经度:', locationData.longitude);
641
- console.log('时间戳:', locationData.timestamp);
642
- console.log('行进速度:', locationData.speed);
643
- console.log('定位精度:', locationData.accuracy);
644
- } catch (error) {
645
- console.error('获取位置失败:', error);
646
- // 处理错误,例如提示用户开启定位权限
647
- }
648
- }
649
-
650
- fetchLocation();
651
- ```
652
-
653
- ***
654
-
655
- ### getNetworkType()
656
-
657
- > **getNetworkType**(`params`?): `Promise`\<[`GetNetworkTypeResult`](doubao-apps-sdk-open-api.md#getnetworktyperesult)\>
658
-
659
- 获取当前网络类型。
660
-
661
- #### Parameters
662
-
663
- • **params?**: [`GetNetworkTypeParams`](doubao-apps-sdk-open-api.md#getnetworktypeparams)
664
-
665
- #### Returns
666
-
667
- `Promise`\<[`GetNetworkTypeResult`](doubao-apps-sdk-open-api.md#getnetworktyperesult)\>
668
-
669
- 返回一个 Promise,解析为 [GetNetworkTypeResult](doubao-apps-sdk-open-api.md#getnetworktyperesult)。
670
-
671
- #### Example
672
-
673
- ```ts
674
- import { getNetworkType } from '@byted-doubao-apps/framework/api';
675
-
676
- const result = await getNetworkType();
677
- console.log(result.networkType);
678
- ```
679
-
680
- ***
681
-
682
- ### getOrderPayment()
683
-
684
- > **getOrderPayment**(`params`): `Promise`\<[`GetOrderPaymentResult`](doubao-apps-sdk-open-api.md#getorderpaymentresult)\>
685
-
686
- #### Parameters
687
-
688
- • **params**: [`GetOrderPaymentParams`](doubao-apps-sdk-open-api.md#getorderpaymentparams)
689
-
690
- #### Returns
691
-
692
- `Promise`\<[`GetOrderPaymentResult`](doubao-apps-sdk-open-api.md#getorderpaymentresult)\>
693
-
694
- ***
695
-
696
- ### getPrivacySetting()
697
-
698
- > **getPrivacySetting**(`params`?): `Promise`\<[`PrivacySettingResult`](doubao-apps-sdk-open-api.md#privacysettingresult)\>
699
-
700
- Get privacy setting information
701
-
702
- #### Parameters
703
-
704
- • **params?**
705
-
706
- #### Returns
707
-
708
- `Promise`\<[`PrivacySettingResult`](doubao-apps-sdk-open-api.md#privacysettingresult)\>
709
-
710
- Returns a Promise containing privacy setting information
711
-
712
- ***
713
-
714
- ### getRandomValues()
715
-
716
- > **getRandomValues**(`params`): `Promise`\<[`GetRandomValuesResult`](doubao-apps-sdk-open-api.md#getrandomvaluesresult)\>
717
-
718
- 获取安全随机数。
719
-
720
- #### Parameters
721
-
722
- • **params**: [`GetRandomValuesParams`](doubao-apps-sdk-open-api.md#getrandomvaluesparams)
723
-
724
- #### Returns
725
-
726
- `Promise`\<[`GetRandomValuesResult`](doubao-apps-sdk-open-api.md#getrandomvaluesresult)\>
727
-
728
- ***
729
-
730
- ### getScreenBrightness()
731
-
732
- > **getScreenBrightness**(`params`?): `Promise`\<[`GetScreenBrightnessResult`](doubao-apps-sdk-open-api.md#getscreenbrightnessresult)\>
733
-
734
- 获取屏幕亮度。
735
-
736
- #### Parameters
737
-
738
- • **params?**
739
-
740
- #### Returns
741
-
742
- `Promise`\<[`GetScreenBrightnessResult`](doubao-apps-sdk-open-api.md#getscreenbrightnessresult)\>
743
-
744
- ***
745
-
746
- ### getSelectedTextRange()
747
-
748
- > **getSelectedTextRange**(`params`?): `Promise`\<[`GetSelectedTextRangeResult`](doubao-apps-sdk-open-api.md#getselectedtextrangeresult)\>
749
-
750
- 获取当前输入框的选区范围。
751
-
752
- #### Parameters
753
-
754
- • **params?**: `Record`\<`string`, `never`\>
755
-
756
- #### Returns
757
-
758
- `Promise`\<[`GetSelectedTextRangeResult`](doubao-apps-sdk-open-api.md#getselectedtextrangeresult)\>
759
-
760
- ***
761
-
762
- ### getStorage()
763
-
764
- > **getStorage**\<`TData`\>(`params`): `Promise`\<[`GetStorageResult`](doubao-apps-sdk-open-api.md#getstorageresulttdata)\<`TData`\>\>
765
-
766
- 从本地缓存读取数据。
767
-
768
- #### Type parameters
769
-
770
- • **TData** = `unknown`
771
-
772
- #### Parameters
773
-
774
- • **params**: [`GetStorageParams`](doubao-apps-sdk-open-api.md#getstorageparams)
775
-
776
- 查询参数,字段见 [GetStorageParams](doubao-apps-sdk-open-api.md#getstorageparams)。
777
-
778
- #### Returns
779
-
780
- `Promise`\<[`GetStorageResult`](doubao-apps-sdk-open-api.md#getstorageresulttdata)\<`TData`\>\>
781
-
782
- 返回一个 Promise,解析为 [GetStorageResult](doubao-apps-sdk-open-api.md#getstorageresulttdata)。
783
-
784
- #### Example
785
-
786
- ```typescript
787
- import { getStorage } from '@doubao-apps/framework/api';
788
-
789
- const result = await getStorage<{ name: string; age: number }>({
790
- key: 'profile',
791
- });
792
-
793
- console.log(result.data.name, result.data.age);
794
- ```
795
-
796
- ***
797
-
798
- ### getStorageInfo()
799
-
800
- > **getStorageInfo**(`params`?): `Promise`\<[`GetStorageInfoResult`](doubao-apps-sdk-open-api.md#getstorageinforesult)\>
801
-
802
- 获取本地缓存信息。
803
-
804
- #### Parameters
805
-
806
- • **params?**
807
-
808
- #### Returns
809
-
810
- `Promise`\<[`GetStorageInfoResult`](doubao-apps-sdk-open-api.md#getstorageinforesult)\>
811
-
812
- 返回一个 Promise,解析为 [GetStorageInfoResult](doubao-apps-sdk-open-api.md#getstorageinforesult)。
813
-
814
- #### Example
815
-
816
- ```typescript
817
- import { getStorageInfo } from '@doubao-apps/framework/api';
818
-
819
- const result = await getStorageInfo();
820
-
821
- console.log(result.keys, result.currentSize, result.limitSize);
822
- ```
823
-
824
- ***
825
-
826
- ### getStorageInfoSync()
827
-
828
- > **getStorageInfoSync**(`params`?): [`GetStorageInfoResult`](doubao-apps-sdk-open-api.md#getstorageinforesult)
829
-
830
- 同步获取本地缓存信息。
831
-
832
- #### Parameters
833
-
834
- • **params?**
835
-
836
- #### Returns
837
-
838
- [`GetStorageInfoResult`](doubao-apps-sdk-open-api.md#getstorageinforesult)
839
-
840
- 返回 [GetStorageInfoResult](doubao-apps-sdk-open-api.md#getstorageinforesult)。
841
-
842
- #### Example
843
-
844
- ```typescript
845
- import { getStorageInfoSync } from '@doubao-apps/framework/api';
846
-
847
- const result = getStorageInfoSync();
848
-
849
- console.log(result.keys, result.currentSize, result.limitSize);
850
- ```
851
-
852
- ***
853
-
854
- ### getStorageSync()
855
-
856
- > **getStorageSync**\<`TData`\>(`params`): [`GetStorageResult`](doubao-apps-sdk-open-api.md#getstorageresulttdata)\<`TData`\>
857
-
858
- 从本地缓存同步读取数据。
859
-
860
- #### Type parameters
861
-
862
- • **TData** = `unknown`
863
-
864
- #### Parameters
865
-
866
- • **params**: [`GetStorageParams`](doubao-apps-sdk-open-api.md#getstorageparams)
867
-
868
- 查询参数,字段见 [GetStorageParams](doubao-apps-sdk-open-api.md#getstorageparams)。
869
-
870
- #### Returns
871
-
872
- [`GetStorageResult`](doubao-apps-sdk-open-api.md#getstorageresulttdata)\<`TData`\>
873
-
874
- 返回 [GetStorageResult](doubao-apps-sdk-open-api.md#getstorageresulttdata)。
875
-
876
- #### Example
877
-
878
- ```typescript
879
- import { getStorageSync } from '@doubao-apps/framework/api';
880
-
881
- const result = getStorageSync<{ name: string; age: number }>({
882
- key: 'profile',
883
- });
884
-
885
- console.log(result.data.name, result.data.age);
886
- ```
887
-
888
- ***
889
-
890
- ### getWifiList()
891
-
892
- > **getWifiList**(`params`?): `Promise`\<[`GetWifiListResult`](doubao-apps-sdk-open-api.md#getwifilistresult)\>
893
-
894
- 获取 Wi-Fi 列表。
895
-
896
- #### Parameters
897
-
898
- • **params?**: `Record`\<`string`, `never`\>
899
-
900
- #### Returns
901
-
902
- `Promise`\<[`GetWifiListResult`](doubao-apps-sdk-open-api.md#getwifilistresult)\>
903
-
904
- ***
905
-
906
- ### getWindowInfo()
907
-
908
- > **getWindowInfo**(`_params`?): `Promise`\<[`GetWindowInfoResult`](doubao-apps-sdk-open-api.md#getwindowinforesult)\>
909
-
910
- 获取窗口信息。
911
-
912
- #### Parameters
913
-
914
- • **\_params?**
915
-
916
- #### Returns
917
-
918
- `Promise`\<[`GetWindowInfoResult`](doubao-apps-sdk-open-api.md#getwindowinforesult)\>
919
-
920
- 返回窗口尺寸、状态栏高度和安全区域等信息,字段见 [GetWindowInfoResult](doubao-apps-sdk-open-api.md#getwindowinforesult)。
921
-
922
- #### Example
923
-
924
- ```typescript
925
- import { getWindowInfo } from '@doubao-apps/framework/api';
926
-
927
- const result = await getWindowInfo();
928
-
929
- console.log(result.windowWidth, result.windowHeight);
930
- console.log(result.safeArea?.top, result.screenTop);
931
- ```
932
-
933
- ***
934
-
935
- ### getWindowInfoSync()
936
-
937
- > **getWindowInfoSync**(`_param`?): [`GetWindowInfoResult`](doubao-apps-sdk-open-api.md#getwindowinforesult)
938
-
939
- 获取窗口信息。
940
-
941
- #### Parameters
942
-
943
- • **\_param?**
944
-
945
- #### Returns
946
-
947
- [`GetWindowInfoResult`](doubao-apps-sdk-open-api.md#getwindowinforesult)
948
-
949
- 返回窗口尺寸、状态栏高度和安全区域等信息,字段见 [GetWindowInfoResult](doubao-apps-sdk-open-api.md#getwindowinforesult)。
950
-
951
- #### Example
952
-
953
- ```typescript
954
- import { getWindowInfoSync } from '@doubao-apps/framework/api';
955
-
956
- const result = getWindowInfoSync();
957
-
958
- console.log(result.windowWidth, result.windowHeight);
959
- console.log(result.safeArea?.top, result.screenTop);
960
- ```
961
-
962
- ***
963
-
964
- ### hideKeyboard()
965
-
966
- > **hideKeyboard**(`params`?): `Promise`\<`object`\>
967
-
968
- 收起键盘。
969
-
970
- #### Parameters
971
-
972
- • **params?**: `Record`\<`string`, `never`\>
973
-
974
- #### Returns
975
-
976
- `Promise`\<`object`\>
977
-
978
- ***
979
-
980
- ### isBluetoothDevicePaired()
981
-
982
- > **isBluetoothDevicePaired**(`params`): `Promise`\<`object`\>
983
-
984
- 查询蓝牙设备是否已经配对。
985
-
986
- #### Parameters
987
-
988
- • **params**: [`IsBluetoothDevicePairedParams`](doubao-apps-sdk-open-api.md#isbluetoothdevicepairedparams)
989
-
990
- #### Returns
991
-
992
- `Promise`\<`object`\>
993
-
994
- ***
995
-
996
- ### login()
997
-
998
- > **login**(`params`?): `Promise`\<[`LoginResult`](doubao-apps-sdk-open-api.md#loginresult)\>
999
-
1000
- Initiate login
1001
-
1002
- #### Parameters
1003
-
1004
- • **params?**: [`LoginRequest`](doubao-apps-sdk-open-api.md#loginrequest)
1005
-
1006
- Login parameters
1007
-
1008
- #### Returns
1009
-
1010
- `Promise`\<[`LoginResult`](doubao-apps-sdk-open-api.md#loginresult)\>
1011
-
1012
- Returns a Promise containing the login credential code
1013
-
1014
- ***
1015
-
1016
- ### loginWithDoubaoWidget()
1017
-
1018
- > **loginWithDoubaoWidget**(`params`): `Promise`\<[`LoginWithWidgetResult`](doubao-apps-sdk-open-api.md#loginwithwidgetresult)\>
1019
-
1020
- Initiate login
1021
-
1022
- #### Parameters
1023
-
1024
- • **params**: [`LoginWithWidgetRequest`](doubao-apps-sdk-open-api.md#loginwithwidgetrequest)
1025
-
1026
- Login parameters
1027
-
1028
- #### Returns
1029
-
1030
- `Promise`\<[`LoginWithWidgetResult`](doubao-apps-sdk-open-api.md#loginwithwidgetresult)\>
1031
-
1032
- Returns a Promise containing the login credential code
1033
-
1034
- ***
1035
-
1036
- ### makeBluetoothPair()
1037
-
1038
- > **makeBluetoothPair**(`params`): `Promise`\<`object`\>
1039
-
1040
- 发起蓝牙配对。
1041
-
1042
- #### Parameters
1043
-
1044
- • **params**: [`MakeBluetoothPairParams`](doubao-apps-sdk-open-api.md#makebluetoothpairparams)
1045
-
1046
- #### Returns
1047
-
1048
- `Promise`\<`object`\>
1049
-
1050
- ***
1051
-
1052
- ### makePhoneCall()
1053
-
1054
- > **makePhoneCall**(`params`): `Promise`\<`object`\>
291
+ ## 设备 / 电话
1055
292
 
1056
293
  拨打电话。
1057
294
 
1058
- #### Parameters
1059
-
1060
- **params**: [`MakePhoneCallParams`](doubao-apps-sdk-open-api.md#makephonecallparams)
1061
-
1062
- #### Returns
1063
-
1064
- `Promise`\<`object`\>
1065
-
1066
- ***
1067
-
1068
- ### navigateBack()
1069
-
1070
- > **navigateBack**(`params`?): `Promise`\<`object`\>
1071
-
1072
- 关闭当前页面,返回上一页面或多级页面。
1073
-
1074
- #### Parameters
1075
-
1076
- • **params?**: [`NavigateBackParams`](doubao-apps-sdk-open-api.md#navigatebackparams)
1077
-
1078
- #### Returns
1079
-
1080
- `Promise`\<`object`\>
1081
-
1082
- ***
1083
-
1084
- ### navigateTo()
1085
-
1086
- > **navigateTo**(`params`): `Promise`\<`object`\>
1087
-
1088
- 保留当前页面,跳转到应用内的某个页面。
1089
-
1090
- #### Parameters
1091
-
1092
- • **params**: [`NavigateToParams`](doubao-apps-sdk-open-api.md#navigatetoparams)
1093
-
1094
- #### Returns
1095
-
1096
- `Promise`\<`object`\>
1097
-
1098
- ***
1099
-
1100
- ### notifyBLECharacteristicValueChange()
1101
-
1102
- > **notifyBLECharacteristicValueChange**(`params`): `Promise`\<`object`\>
1103
-
1104
- 订阅 BLE 特征值变化。
1105
-
1106
- #### Parameters
1107
-
1108
- • **params**: [`NotifyBLECharacteristicValueChangeParams`](doubao-apps-sdk-open-api.md#notifyblecharacteristicvaluechangeparams)
1109
-
1110
- #### Returns
1111
-
1112
- `Promise`\<`object`\>
1113
-
1114
- ***
1115
-
1116
- ### onKeyboardHeightChange()
1117
-
1118
- > **onKeyboardHeightChange**(`handler`): () => `void`
1119
-
1120
- 监听键盘高度变化事件。
1121
-
1122
- #### Parameters
1123
-
1124
- • **handler**
1125
-
1126
- #### Returns
1127
-
1128
- `Function`
1129
-
1130
- ##### Returns
1131
-
1132
- `void`
1133
-
1134
- #### Example
1135
-
1136
- ```typescript
1137
- import { onKeyboardHeightChange } from '@doubao-apps/framework/api';
1138
-
1139
- const unsubscribe = onKeyboardHeightChange(({ height }) => {
1140
- console.log('Keyboard height change event:', { height });
1141
- });
1142
- ```
1143
-
1144
- ***
1145
-
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.
1151
-
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.
1156
-
1157
- Returns a Promise that resolves with an execution status and optional message.
1158
-
1159
- #### Parameters
1160
-
1161
- • **params**: [`OpenAppRequest`](doubao-apps-sdk-open-api.md#openapprequest)
1162
-
1163
- #### Returns
1164
-
1165
- `Promise`\<[`OpenAppResult`](doubao-apps-sdk-open-api.md#openappresult)\>
1166
-
1167
- ***
1168
-
1169
- ### openBluetoothAdapter()
1170
-
1171
- > **openBluetoothAdapter**(`params`?): `Promise`\<`object`\>
1172
-
1173
- 打开蓝牙适配器。
1174
-
1175
- #### Parameters
1176
-
1177
- • **params?**: [`OpenBluetoothAdapterParams`](doubao-apps-sdk-open-api.md#openbluetoothadapterparams)
1178
-
1179
- #### Returns
1180
-
1181
- `Promise`\<`object`\>
1182
-
1183
- ***
1184
-
1185
- ### postLoginResult()
1186
-
1187
- > **postLoginResult**(`params`): `Promise`\<`object`\>
1188
-
1189
- Report MCP authorization login credential
1190
-
1191
- #### Parameters
1192
-
1193
- • **params**: [`PostLoginResultRequest`](doubao-apps-sdk-open-api.md#postloginresultrequest)
1194
-
1195
- Post login result parameters
1196
-
1197
- #### Returns
1198
-
1199
- `Promise`\<`object`\>
1200
-
1201
- Returns a Promise that resolves when the report is successful
1202
-
1203
- ***
1204
-
1205
- ### reLaunch()
1206
-
1207
- > **reLaunch**(`params`): `Promise`\<`object`\>
1208
-
1209
- #### Parameters
1210
-
1211
- • **params**: [`NavigateToParams`](doubao-apps-sdk-open-api.md#navigatetoparams)
1212
-
1213
- #### Returns
1214
-
1215
- `Promise`\<`object`\>
1216
-
1217
- ***
1218
-
1219
- ### readBLECharacteristicValue()
1220
-
1221
- > **readBLECharacteristicValue**(`params`): `Promise`\<`object`\>
1222
-
1223
- 读取 BLE 特征值。
1224
-
1225
- #### Parameters
1226
-
1227
- • **params**: [`ReadBLECharacteristicValueParams`](doubao-apps-sdk-open-api.md#readblecharacteristicvalueparams)
1228
-
1229
- #### Returns
1230
-
1231
- `Promise`\<`object`\>
1232
-
1233
- ***
1234
-
1235
- ### redirectTo()
1236
-
1237
- > **redirectTo**(`params`): `Promise`\<`object`\>
1238
-
1239
- 关闭当前页面,跳转到应用内的某个页面。
1240
-
1241
- #### Parameters
1242
-
1243
- • **params**: [`NavigateToParams`](doubao-apps-sdk-open-api.md#navigatetoparams)
1244
-
1245
- #### Returns
1246
-
1247
- `Promise`\<`object`\>
1248
-
1249
- ***
1250
-
1251
- ### removeStorage()
1252
-
1253
- > **removeStorage**(`params`): `Promise`\<`object`\>
1254
-
1255
- 删除本地缓存中指定 key 的数据。
1256
-
1257
- #### Parameters
1258
-
1259
- • **params**: [`RemoveStorageParams`](doubao-apps-sdk-open-api.md#removestorageparams)
1260
-
1261
- 删除参数,字段见 [RemoveStorageParams](doubao-apps-sdk-open-api.md#removestorageparams)。
1262
-
1263
- #### Returns
1264
-
1265
- `Promise`\<`object`\>
1266
-
1267
- 返回一个 Promise,删除完成后 resolve。
1268
-
1269
- #### Example
1270
-
1271
- ```typescript
1272
- import { removeStorage } from '@doubao-apps/framework/api';
1273
-
1274
- await removeStorage({ key: 'profile' });
1275
- ```
1276
-
1277
- ***
1278
-
1279
- ### removeStorageSync()
1280
-
1281
- > **removeStorageSync**(`params`?): `object`
1282
-
1283
- 删除本地缓存中指定 key 的数据。
1284
-
1285
- #### Parameters
1286
-
1287
- • **params?**: [`RemoveStorageParams`](doubao-apps-sdk-open-api.md#removestorageparams)
1288
-
1289
- 删除参数,字段见 [RemoveStorageParams](doubao-apps-sdk-open-api.md#removestorageparams)。
1290
-
1291
- #### Returns
1292
-
1293
- `object`
1294
-
1295
- 同步删除完成后返回。
1296
-
1297
- #### Example
1298
-
1299
- ```typescript
1300
- import { removeStorageSync } from '@doubao-apps/framework/api';
1301
-
1302
- removeStorageSync({ key: 'profile' });
1303
- ```
1304
-
1305
- ***
1306
-
1307
- ### request()
1308
-
1309
- > **request**(`params`): `Promise`\<[`RequestResponse`](doubao-apps-sdk-open-api.md#requestresponse)\>
1310
-
1311
- 发起网络请求。
1312
-
1313
- #### Parameters
1314
-
1315
- • **params**: [`RequestParams`](doubao-apps-sdk-open-api.md#requestparams)
1316
-
1317
- 请求参数,字段见 [RequestParams](doubao-apps-sdk-open-api.md#requestparams)。
1318
-
1319
- #### Returns
1320
-
1321
- `Promise`\<[`RequestResponse`](doubao-apps-sdk-open-api.md#requestresponse)\>
1322
-
1323
- 返回一个 Promise,解析为 [RequestResponse](doubao-apps-sdk-open-api.md#requestresponse)。
1324
-
1325
- #### Example
1326
-
1327
- ```typescript
1328
- import { request } from '@doubao-apps/framework/api';
1329
-
1330
- const result = await request({
1331
- url: 'https://postman-echo.com/post',
1332
- method: 'POST',
1333
- dataType: 'json',
1334
- header: { 'content-type': 'application/json' },
1335
- data: { hello: 'world' }
1336
- });
1337
-
1338
- console.log(result.statusCode, result.data);
1339
- ```
1340
-
1341
- ***
1342
-
1343
- ### requestOrder()
1344
-
1345
- > **requestOrder**(`params`): `Promise`\<[`RequestOrderResult`](doubao-apps-sdk-open-api.md#requestorderresult)\>
1346
-
1347
- #### Parameters
1348
-
1349
- • **params**: [`RequestOrderParams`](doubao-apps-sdk-open-api.md#requestorderparams)
1350
-
1351
- #### Returns
1352
-
1353
- `Promise`\<[`RequestOrderResult`](doubao-apps-sdk-open-api.md#requestorderresult)\>
1354
-
1355
- ***
1356
-
1357
- ### scanCode()
1358
-
1359
- > **scanCode**(`params`?): `Promise`\<[`ScanCodeResult`](doubao-apps-sdk-open-api.md#scancoderesult)\>
1360
-
1361
- 调起扫码能力。
1362
-
1363
- #### Parameters
1364
-
1365
- • **params?**: [`ScanCodeParams`](doubao-apps-sdk-open-api.md#scancodeparams)
1366
-
1367
- #### Returns
1368
-
1369
- `Promise`\<[`ScanCodeResult`](doubao-apps-sdk-open-api.md#scancoderesult)\>
1370
-
1371
- ***
1372
-
1373
- ### sendHCEMessage()
1374
-
1375
- > **sendHCEMessage**(`params`): `Promise`\<`object`\>
1376
-
1377
- 发送 HCE 消息。
1378
-
1379
- #### Parameters
1380
-
1381
- • **params**: [`SendHCEMessageParams`](doubao-apps-sdk-open-api.md#sendhcemessageparams)
1382
-
1383
- #### Returns
1384
-
1385
- `Promise`\<`object`\>
1386
-
1387
- ***
1388
-
1389
- ### sendQueryMessage()
1390
-
1391
- > **sendQueryMessage**(`params`): `void`
1392
-
1393
- 以用户身份发送一条消息
1394
-
1395
- 由于会自动获取页面上下文来确定向哪个 bot 发送消息,因此只能在卡片或页面中调用
1396
-
1397
- #### Parameters
1398
-
1399
- • **params**: [`SendQueryMessageParams`](doubao-apps-sdk-open-api.md#sendquerymessageparams)
1400
-
1401
- #### Returns
1402
-
1403
- `void`
1404
-
1405
- #### Example
1406
-
1407
- ```ts
1408
- await sendQueryMessage({ content: '订阅消息', type: 'text' })
1409
- ```
1410
-
1411
- ***
1412
-
1413
- ### sendSms()
1414
-
1415
- > **sendSms**(`params`?): `Promise`\<`object`\>
1416
-
1417
- 拉起系统短信发送面板。
1418
-
1419
- #### Parameters
1420
-
1421
- • **params?**: [`SendSmsParams`](doubao-apps-sdk-open-api.md#sendsmsparams)
1422
-
1423
- #### Returns
1424
-
1425
- `Promise`\<`object`\>
1426
-
1427
- 返回一个 Promise,在成功拉起短信发送面板时解析。
1428
-
1429
- #### Example
1430
-
1431
- ```typescript
1432
- import { sendSms } from '@doubao-apps/framework/api';
1433
-
1434
- await sendSms({
1435
- phoneNumber: '10086',
1436
- message: '查询话费'
1437
- });
1438
- ```
1439
-
1440
- ***
1441
-
1442
- ### setAdditionalContext()
1443
-
1444
- > **setAdditionalContext**(`params`): `Promise`\<`object`\>
1445
-
1446
- 设置全局上下文供大模型理解
1447
-
1448
- #### Parameters
1449
-
1450
- • **params**
1451
-
1452
- • **params.additionalContext**: `string`
1453
-
1454
- 上下文内容
1455
-
1456
- • **params.botId?**: `string`
1457
-
1458
- 指定 bot id
1459
-
1460
- #### Returns
1461
-
1462
- `Promise`\<`object`\>
1463
-
1464
- ***
1465
-
1466
- ### setBLEMTU()
1467
-
1468
- > **setBLEMTU**(`params`): `Promise`\<[`SetBLEMTUResult`](doubao-apps-sdk-open-api.md#setblemturesult)\>
1469
-
1470
- 设置 BLE MTU。
1471
-
1472
- #### Parameters
1473
-
1474
- • **params**: [`SetBLEMTUParams`](doubao-apps-sdk-open-api.md#setblemtuparams)
1475
-
1476
- #### Returns
1477
-
1478
- `Promise`\<[`SetBLEMTUResult`](doubao-apps-sdk-open-api.md#setblemturesult)\>
1479
-
1480
- ***
1481
-
1482
- ### setClipboardData()
1483
-
1484
- > **setClipboardData**(`params`): `Promise`\<`object`\>
1485
-
1486
- 设置系统剪贴板内容。
1487
-
1488
- #### Parameters
1489
-
1490
- • **params**: [`SetClipboardDataParams`](doubao-apps-sdk-open-api.md#setclipboarddataparams)
1491
-
1492
- #### Returns
1493
-
1494
- `Promise`\<`object`\>
1495
-
1496
- ***
1497
-
1498
- ### setKeepScreenOn()
1499
-
1500
- > **setKeepScreenOn**(`params`): `Promise`\<`object`\>
1501
-
1502
- 设置屏幕常亮状态。
1503
-
1504
- #### Parameters
1505
-
1506
- • **params**: [`SetKeepScreenOnParams`](doubao-apps-sdk-open-api.md#setkeepscreenonparams)
1507
-
1508
- #### Returns
1509
-
1510
- `Promise`\<`object`\>
1511
-
1512
- ***
1513
-
1514
- ### setScreenBrightness()
1515
-
1516
- > **setScreenBrightness**(`params`): `Promise`\<`object`\>
1517
-
1518
- 设置屏幕亮度。
1519
-
1520
- #### Parameters
1521
-
1522
- • **params**: [`SetScreenBrightnessParams`](doubao-apps-sdk-open-api.md#setscreenbrightnessparams)
1523
-
1524
- #### Returns
1525
-
1526
- `Promise`\<`object`\>
1527
-
1528
- ***
1529
-
1530
- ### setStorage()
1531
-
1532
- > **setStorage**\<`TData`\>(`params`): `Promise`\<`object`\>
1533
-
1534
- 将数据写入本地缓存。
1535
-
1536
- #### Type parameters
1537
-
1538
- • **TData** = `unknown`
1539
-
1540
- #### Parameters
1541
-
1542
- • **params**: [`SetStorageParams`](doubao-apps-sdk-open-api.md#setstorageparamstdata)\<`TData`\>
1543
-
1544
- 存储参数,字段见 [SetStorageParams](doubao-apps-sdk-open-api.md#setstorageparamstdata)。
1545
-
1546
- #### Returns
1547
-
1548
- `Promise`\<`object`\>
1549
-
1550
- 返回一个 Promise,写入完成后 resolve。
1551
-
1552
- #### Example
1553
-
1554
- ```typescript
1555
- import { setStorage } from '@doubao-apps/framework/api';
1556
-
1557
- await setStorage({
1558
- key: 'profile',
1559
- data: { name: 'Tom', age: 18 },
1560
- });
1561
- ```
1562
-
1563
- ***
1564
-
1565
- ### setStorageSync()
1566
-
1567
- > **setStorageSync**\<`TData`\>(`params`): `object`
1568
-
1569
- 将数据写入本地缓存。
1570
-
1571
- #### Type parameters
1572
-
1573
- • **TData** = `unknown`
1574
-
1575
- #### Parameters
1576
-
1577
- • **params**: [`SetStorageParams`](doubao-apps-sdk-open-api.md#setstorageparamstdata)\<`TData`\>
1578
-
1579
- 存储参数,字段见 [SetStorageParams](doubao-apps-sdk-open-api.md#setstorageparamstdata)。
1580
-
1581
- #### Returns
1582
-
1583
- `object`
1584
-
1585
- 同步写入完成后返回。
1586
-
1587
- #### Example
1588
-
1589
- ```typescript
1590
- import { setStorageSync } from '@doubao-apps/framework/api';
1591
-
1592
- setStorageSync({
1593
- key: 'profile',
1594
- data: { name: 'Tom', age: 18 },
1595
- });
1596
- ```
1597
-
1598
- ***
1599
-
1600
- ### setVisualEffectOnCapture()
1601
-
1602
- > **setVisualEffectOnCapture**(`params`?): `Promise`\<`object`\>
1603
-
1604
- 设置截屏或录屏时的视觉表现。
1605
-
1606
- #### Parameters
1607
-
1608
- • **params?**: [`SetVisualEffectOnCaptureParams`](doubao-apps-sdk-open-api.md#setvisualeffectoncaptureparams)
1609
-
1610
- #### Returns
1611
-
1612
- `Promise`\<`object`\>
1613
-
1614
- ***
1615
-
1616
- ### setWifiList()
1617
-
1618
- > **setWifiList**(`params`): `Promise`\<`object`\>
1619
-
1620
- 设置 Wi-Fi 预设列表。
1621
-
1622
- #### Parameters
1623
-
1624
- • **params**: [`SetWifiListParams`](doubao-apps-sdk-open-api.md#setwifilistparams)
1625
-
1626
- #### Returns
1627
-
1628
- `Promise`\<`object`\>
1629
-
1630
- ***
1631
-
1632
- ### showToast()
1633
-
1634
- > **showToast**(`params`): `Promise`\<`object`\>
1635
-
1636
- 显示 Toast 提示。
1637
-
1638
- 参数 `options` 包含以下字段:
1639
- - `message`: 提示的内容。
1640
- - `type`: Toast 的类型,可选值为 'success' 或 'error'。
1641
- - `duration`: 提示的延迟时间,单位毫秒,默认为 2000。
1642
- - `icon`: 图标,可选值为 'success', 'error', 'warn'。
1643
- - `customIcon`: 自定义图标的 URL 或 base64 字符串。
1644
-
1645
- #### Parameters
1646
-
1647
- • **params**: [`ShowToastParams`](doubao-apps-sdk-open-api.md#showtoastparams)
1648
-
1649
- #### Returns
1650
-
1651
- `Promise`\<`object`\>
1652
-
1653
- 返回一个 Promise,在 Toast 显示结束时 resolve。
1654
-
1655
- #### Example
1656
-
1657
- ```typescript
1658
- import { showToast } from '@byted-doubao-apps/framework';
1659
-
1660
- // 显示一个成功的 Toast
1661
- showToast({
1662
- message: '操作成功',
1663
- type: 'success',
1664
- icon: 'success',
1665
- duration: 1500
1666
- }).then(() => {
1667
- console.log('Toast 显示完毕');
1668
- });
1669
-
1670
- // 显示一个错误的 Toast
1671
- showToast({
1672
- message: '网络错误',
1673
- type: 'error',
1674
- icon: 'error'
1675
- });
1676
- ```
1677
-
1678
- ***
1679
-
1680
- ### startAccelerometer()
1681
-
1682
- > **startAccelerometer**(`params`?): `Promise`\<`object`\>
1683
-
1684
- 开始监听加速度。
1685
-
1686
- #### Parameters
1687
-
1688
- • **params?**: [`StartAccelerometerParams`](doubao-apps-sdk-open-api.md#startaccelerometerparams)
1689
-
1690
- #### Returns
1691
-
1692
- `Promise`\<`object`\>
1693
-
1694
- ***
1695
-
1696
- ### startBeaconDiscovery()
1697
-
1698
- > **startBeaconDiscovery**(`params`): `Promise`\<`object`\>
1699
-
1700
- 开始搜索附近的 iBeacon。
1701
-
1702
- #### Parameters
1703
-
1704
- • **params**: [`StartBeaconDiscoveryParams`](doubao-apps-sdk-open-api.md#startbeacondiscoveryparams)
1705
-
1706
- #### Returns
1707
-
1708
- `Promise`\<`object`\>
1709
-
1710
- ***
1711
-
1712
- ### startBluetoothDevicesDiscovery()
1713
-
1714
- > **startBluetoothDevicesDiscovery**(`params`?): `Promise`\<`object`\>
1715
-
1716
- 开始搜索附近的蓝牙设备。
1717
-
1718
- #### Parameters
1719
-
1720
- • **params?**: [`StartBluetoothDevicesDiscoveryParams`](doubao-apps-sdk-open-api.md#startbluetoothdevicesdiscoveryparams)
1721
-
1722
- #### Returns
1723
-
1724
- `Promise`\<`object`\>
1725
-
1726
- ***
1727
-
1728
- ### startCompass()
1729
-
1730
- > **startCompass**(`params`?): `Promise`\<`object`\>
1731
-
1732
- 开始监听罗盘。
1733
-
1734
- #### Parameters
1735
-
1736
- • **params?**: `Record`\<`string`, `never`\>
1737
-
1738
- #### Returns
1739
-
1740
- `Promise`\<`object`\>
1741
-
1742
- ***
1743
-
1744
- ### startDeviceMotionListening()
1745
-
1746
- > **startDeviceMotionListening**(`params`?): `Promise`\<`object`\>
1747
-
1748
- 开始监听设备方向变化。
1749
-
1750
- #### Parameters
1751
-
1752
- • **params?**: [`StartDeviceMotionListeningParams`](doubao-apps-sdk-open-api.md#startdevicemotionlisteningparams)
1753
-
1754
- #### Returns
1755
-
1756
- `Promise`\<`object`\>
1757
-
1758
- ***
1759
-
1760
- ### startGyroscope()
1761
-
1762
- > **startGyroscope**(`params`?): `Promise`\<`object`\>
1763
-
1764
- 开始监听陀螺仪。
1765
-
1766
- #### Parameters
1767
-
1768
- • **params?**: [`StartGyroscopeParams`](doubao-apps-sdk-open-api.md#startgyroscopeparams)
1769
-
1770
- #### Returns
1771
-
1772
- `Promise`\<`object`\>
1773
-
1774
- ***
1775
-
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`\>
1789
-
1790
- ***
1791
-
1792
- ### startWifi()
1793
-
1794
- > **startWifi**(`params`?): `Promise`\<`object`\>
1795
-
1796
- 初始化 Wi-Fi 模块。
1797
-
1798
- #### Parameters
1799
-
1800
- • **params?**: `Record`\<`string`, `never`\>
1801
-
1802
- #### Returns
1803
-
1804
- `Promise`\<`object`\>
1805
-
1806
- ***
1807
-
1808
- ### stopAccelerometer()
1809
-
1810
- > **stopAccelerometer**(`params`?): `Promise`\<`object`\>
1811
-
1812
- 停止监听加速度。
1813
-
1814
- #### Parameters
1815
-
1816
- • **params?**: `Record`\<`string`, `never`\>
1817
-
1818
- #### Returns
1819
-
1820
- `Promise`\<`object`\>
1821
-
1822
- ***
1823
-
1824
- ### stopBeaconDiscovery()
1825
-
1826
- > **stopBeaconDiscovery**(`params`?): `Promise`\<`object`\>
1827
-
1828
- 停止搜索附近的 iBeacon。
1829
-
1830
- #### Parameters
1831
-
1832
- • **params?**: `Record`\<`string`, `never`\>
1833
-
1834
- #### Returns
1835
-
1836
- `Promise`\<`object`\>
1837
-
1838
- ***
1839
-
1840
- ### stopBluetoothDevicesDiscovery()
1841
-
1842
- > **stopBluetoothDevicesDiscovery**(`params`?): `Promise`\<`object`\>
1843
-
1844
- 停止搜索附近的蓝牙设备。
1845
-
1846
- #### Parameters
1847
-
1848
- • **params?**: `Record`\<`string`, `never`\>
1849
-
1850
- #### Returns
1851
-
1852
- `Promise`\<`object`\>
1853
-
1854
- ***
1855
-
1856
- ### stopCompass()
1857
-
1858
- > **stopCompass**(`params`?): `Promise`\<`object`\>
1859
-
1860
- 停止监听罗盘。
1861
-
1862
- #### Parameters
1863
-
1864
- • **params?**: `Record`\<`string`, `never`\>
1865
-
1866
- #### Returns
1867
-
1868
- `Promise`\<`object`\>
1869
-
1870
- ***
1871
-
1872
- ### stopDeviceMotionListening()
1873
-
1874
- > **stopDeviceMotionListening**(`params`?): `Promise`\<`object`\>
1875
-
1876
- 停止监听设备方向变化。
1877
-
1878
- #### Parameters
1879
-
1880
- • **params?**: `Record`\<`string`, `never`\>
1881
-
1882
- #### Returns
1883
-
1884
- `Promise`\<`object`\>
1885
-
1886
- ***
1887
-
1888
- ### stopGyroscope()
1889
-
1890
- > **stopGyroscope**(`params`?): `Promise`\<`object`\>
1891
-
1892
- 停止监听陀螺仪。
1893
-
1894
- #### Parameters
1895
-
1896
- • **params?**: `Record`\<`string`, `never`\>
1897
-
1898
- #### Returns
1899
-
1900
- `Promise`\<`object`\>
1901
-
1902
- ***
1903
-
1904
- ### stopHCE()
1905
-
1906
- > **stopHCE**(`params`?): `Promise`\<`object`\>
1907
-
1908
- 停止 HCE。
1909
-
1910
- #### Parameters
1911
-
1912
- • **params?**: `Record`\<`string`, `never`\>
1913
-
1914
- #### Returns
1915
-
1916
- `Promise`\<`object`\>
1917
-
1918
- ***
1919
-
1920
- ### stopWifi()
1921
-
1922
- > **stopWifi**(`params`?): `Promise`\<`object`\>
1923
-
1924
- 关闭 Wi-Fi 模块。
1925
-
1926
- #### Parameters
1927
-
1928
- • **params?**: `Record`\<`string`, `never`\>
1929
-
1930
- #### Returns
1931
-
1932
- `Promise`\<`object`\>
1933
-
1934
- ***
1935
-
1936
- ### updateModelContext()
1937
-
1938
- > **updateModelContext**(`params`?): `Promise`\<`object`\>
1939
-
1940
- 前端数据捐献接口:上报当前业务状态/关键信息(blocks)。
1941
-
1942
- #### Parameters
1943
-
1944
- • **params?**: [`UpdateModelContextOptions`](doubao-apps-sdk-open-api.md#updatemodelcontextoptions)
1945
-
1946
- #### Returns
1947
-
1948
- `Promise`\<`object`\>
1949
-
1950
- ***
1951
-
1952
- ### vibrateLong()
1953
-
1954
- > **vibrateLong**(`params`?): `Promise`\<`object`\>
1955
-
1956
- 触发长震动。
1957
-
1958
- #### Parameters
1959
-
1960
- • **params?**: `Record`\<`string`, `never`\>
1961
-
1962
- #### Returns
1963
-
1964
- `Promise`\<`object`\>
1965
-
1966
- ***
1967
-
1968
- ### vibrateShort()
1969
-
1970
- > **vibrateShort**(`params`?): `Promise`\<`object`\>
1971
-
1972
- 触发短震动。
1973
-
1974
- #### Parameters
1975
-
1976
- • **params?**: [`VibrateShortParams`](doubao-apps-sdk-open-api.md#vibrateshortparams)
1977
-
1978
- #### Returns
1979
-
1980
- `Promise`\<`object`\>
1981
-
1982
- ***
1983
-
1984
- ### writeBLECharacteristicValue()
1985
-
1986
- > **writeBLECharacteristicValue**(`params`): `Promise`\<`object`\>
1987
-
1988
- 写入 BLE 特征值。
1989
-
1990
- #### Parameters
1991
-
1992
- • **params**: [`WriteBLECharacteristicValueParams`](doubao-apps-sdk-open-api.md#writeblecharacteristicvalueparams)
1993
-
1994
- #### Returns
1995
-
1996
- `Promise`\<`object`\>
1997
-
1998
- ## Interfaces
1999
-
2000
- ### AddPhoneCalendarParams
2001
-
2002
- 添加系统日历事件的请求参数。
2003
-
2004
- #### Extended by
2005
-
2006
- - [`AddPhoneRepeatCalendarParams`](doubao-apps-sdk-open-api.md#addphonerepeatcalendarparams)
2007
-
2008
- #### Properties
2009
-
2010
- ##### alarm?
2011
-
2012
- > `optional` **alarm**: `boolean`
2013
-
2014
- 是否提醒。
2015
-
2016
- ##### alarmOffset?
2017
-
2018
- > `optional` **alarmOffset**: `number`
2019
-
2020
- 提前提醒时间,单位秒。
2021
-
2022
- ##### allDay?
2023
-
2024
- > `optional` **allDay**: `boolean`
2025
-
2026
- 是否为全天事件。
2027
-
2028
- ##### description?
2029
-
2030
- > `optional` **description**: `string`
2031
-
2032
- 事件描述。
2033
-
2034
- ##### endTime?
2035
-
2036
- > `optional` **endTime**: `number`
2037
-
2038
- 结束时间的 Unix 秒级时间戳。
2039
-
2040
- ##### location?
2041
-
2042
- > `optional` **location**: `string`
2043
-
2044
- 事件位置。
2045
-
2046
- ##### startTime
2047
-
2048
- > **startTime**: `number`
2049
-
2050
- 开始时间的 Unix 秒级时间戳。
2051
-
2052
- ##### title
2053
-
2054
- > **title**: `string`
2055
-
2056
- 日历事件标题。
2057
-
2058
- ***
2059
-
2060
- ### AddPhoneContactParams
2061
-
2062
- 添加手机联系人的请求参数。
2063
-
2064
- #### Properties
2065
-
2066
- ##### addressCity?
2067
-
2068
- > `optional` **addressCity**: `string`
2069
-
2070
- 家庭地址城市。
2071
-
2072
- ##### addressCountry?
2073
-
2074
- > `optional` **addressCountry**: `string`
2075
-
2076
- 家庭地址国家。
2077
-
2078
- ##### addressPostalCode?
2079
-
2080
- > `optional` **addressPostalCode**: `string`
2081
-
2082
- 家庭地址邮编。
2083
-
2084
- ##### addressState?
2085
-
2086
- > `optional` **addressState**: `string`
2087
-
2088
- 家庭地址省份。
2089
-
2090
- ##### addressStreet?
2091
-
2092
- > `optional` **addressStreet**: `string`
2093
-
2094
- 家庭地址街道。
2095
-
2096
- ##### email?
2097
-
2098
- > `optional` **email**: `string`
2099
-
2100
- 电子邮件。
2101
-
2102
- ##### firstName
2103
-
2104
- > **firstName**: `string`
2105
-
2106
- 名字。
2107
-
2108
- ##### homeAddressCity?
2109
-
2110
- > `optional` **homeAddressCity**: `string`
2111
-
2112
- 家庭地址城市。
2113
-
2114
- ##### homeAddressCountry?
2115
-
2116
- > `optional` **homeAddressCountry**: `string`
2117
-
2118
- 家庭地址国家。
2119
-
2120
- ##### homeAddressPostalCode?
2121
-
2122
- > `optional` **homeAddressPostalCode**: `string`
2123
-
2124
- 家庭地址邮编。
2125
-
2126
- ##### homeAddressState?
2127
-
2128
- > `optional` **homeAddressState**: `string`
2129
-
2130
- 家庭地址省份。
2131
-
2132
- ##### homeAddressStreet?
2133
-
2134
- > `optional` **homeAddressStreet**: `string`
2135
-
2136
- 家庭地址街道。
2137
-
2138
- ##### homeFaxNumber?
2139
-
2140
- > `optional` **homeFaxNumber**: `string`
2141
-
2142
- 家庭传真。
2143
-
2144
- ##### homePhoneNumber?
2145
-
2146
- > `optional` **homePhoneNumber**: `string`
2147
-
2148
- 家庭电话。
2149
-
2150
- ##### hostNumber?
2151
-
2152
- > `optional` **hostNumber**: `string`
2153
-
2154
- 公司电话。
2155
-
2156
- ##### lastName?
2157
-
2158
- > `optional` **lastName**: `string`
2159
-
2160
- 姓。
2161
-
2162
- ##### middleName?
2163
-
2164
- > `optional` **middleName**: `string`
2165
-
2166
- 中间名。
2167
-
2168
- ##### mobilePhoneNumber?
2169
-
2170
- > `optional` **mobilePhoneNumber**: `string`
2171
-
2172
- 手机号。
2173
-
2174
- ##### nickName?
2175
-
2176
- > `optional` **nickName**: `string`
2177
-
2178
- 昵称。
2179
-
2180
- ##### organization?
2181
-
2182
- > `optional` **organization**: `string`
2183
-
2184
- 公司。
2185
-
2186
- ##### photoFilePath?
2187
-
2188
- > `optional` **photoFilePath**: `string`
2189
-
2190
- 头像文件路径。
2191
-
2192
- ##### remark?
2193
-
2194
- > `optional` **remark**: `string`
2195
-
2196
- 备注。
2197
-
2198
- ##### title?
2199
-
2200
- > `optional` **title**: `string`
2201
-
2202
- 职位。
2203
-
2204
- ##### url?
2205
-
2206
- > `optional` **url**: `string`
2207
-
2208
- 个人网站。
2209
-
2210
- ##### weChatNumber?
2211
-
2212
- > `optional` **weChatNumber**: `string`
2213
-
2214
- 微信号。
2215
-
2216
- ##### workAddressCity?
2217
-
2218
- > `optional` **workAddressCity**: `string`
2219
-
2220
- 工作地址城市。
2221
-
2222
- ##### workAddressCountry?
2223
-
2224
- > `optional` **workAddressCountry**: `string`
2225
-
2226
- 工作地址国家。
2227
-
2228
- ##### workAddressPostalCode?
2229
-
2230
- > `optional` **workAddressPostalCode**: `string`
2231
-
2232
- 工作地址邮编。
2233
-
2234
- ##### workAddressState?
2235
-
2236
- > `optional` **workAddressState**: `string`
2237
-
2238
- 工作地址省份。
2239
-
2240
- ##### workAddressStreet?
2241
-
2242
- > `optional` **workAddressStreet**: `string`
2243
-
2244
- 工作地址街道。
2245
-
2246
- ##### workFaxNumber?
2247
-
2248
- > `optional` **workFaxNumber**: `string`
2249
-
2250
- 工作传真。
2251
-
2252
- ##### workPhoneNumber?
2253
-
2254
- > `optional` **workPhoneNumber**: `string`
2255
-
2256
- 工作电话。
2257
-
2258
- ***
2259
-
2260
- ### AddPhoneRepeatCalendarParams
2261
-
2262
- 添加重复日历事件的请求参数。
2263
-
2264
- #### Extends
2265
-
2266
- - [`AddPhoneCalendarParams`](doubao-apps-sdk-open-api.md#addphonecalendarparams)
2267
-
2268
- #### Properties
2269
-
2270
- ##### alarm?
2271
-
2272
- > `optional` **alarm**: `boolean`
2273
-
2274
- 是否提醒。
2275
-
2276
- ###### Inherited from
2277
-
2278
- [`AddPhoneCalendarParams`](doubao-apps-sdk-open-api.md#addphonecalendarparams).[`alarm`](doubao-apps-sdk-open-api.md#alarm)
2279
-
2280
- ##### alarmOffset?
2281
-
2282
- > `optional` **alarmOffset**: `number`
2283
-
2284
- 提前提醒时间,单位秒。
2285
-
2286
- ###### Inherited from
2287
-
2288
- [`AddPhoneCalendarParams`](doubao-apps-sdk-open-api.md#addphonecalendarparams).[`alarmOffset`](doubao-apps-sdk-open-api.md#alarmoffset)
2289
-
2290
- ##### allDay?
2291
-
2292
- > `optional` **allDay**: `boolean`
2293
-
2294
- 是否为全天事件。
2295
-
2296
- ###### Inherited from
2297
-
2298
- [`AddPhoneCalendarParams`](doubao-apps-sdk-open-api.md#addphonecalendarparams).[`allDay`](doubao-apps-sdk-open-api.md#allday)
2299
-
2300
- ##### description?
2301
-
2302
- > `optional` **description**: `string`
2303
-
2304
- 事件描述。
2305
-
2306
- ###### Inherited from
2307
-
2308
- [`AddPhoneCalendarParams`](doubao-apps-sdk-open-api.md#addphonecalendarparams).[`description`](doubao-apps-sdk-open-api.md#description)
2309
-
2310
- ##### endTime?
2311
-
2312
- > `optional` **endTime**: `number`
2313
-
2314
- 结束时间的 Unix 秒级时间戳。
2315
-
2316
- ###### Inherited from
2317
-
2318
- [`AddPhoneCalendarParams`](doubao-apps-sdk-open-api.md#addphonecalendarparams).[`endTime`](doubao-apps-sdk-open-api.md#endtime)
2319
-
2320
- ##### location?
2321
-
2322
- > `optional` **location**: `string`
2323
-
2324
- 事件位置。
2325
-
2326
- ###### Inherited from
2327
-
2328
- [`AddPhoneCalendarParams`](doubao-apps-sdk-open-api.md#addphonecalendarparams).[`location`](doubao-apps-sdk-open-api.md#location)
2329
-
2330
- ##### repeatEndTime?
2331
-
2332
- > `optional` **repeatEndTime**: `number`
2333
-
2334
- 重复结束时间的 Unix 秒级时间戳。
2335
-
2336
- ##### repeatInterval?
2337
-
2338
- > `optional` **repeatInterval**: [`CalendarRepeatInterval`](doubao-apps-sdk-open-api.md#calendarrepeatinterval)
2339
-
2340
- 重复周期。
2341
-
2342
- ##### startTime
2343
-
2344
- > **startTime**: `number`
2345
-
2346
- 开始时间的 Unix 秒级时间戳。
2347
-
2348
- ###### Inherited from
2349
-
2350
- [`AddPhoneCalendarParams`](doubao-apps-sdk-open-api.md#addphonecalendarparams).[`startTime`](doubao-apps-sdk-open-api.md#starttime)
2351
-
2352
- ##### title
2353
-
2354
- > **title**: `string`
2355
-
2356
- 日历事件标题。
2357
-
2358
- ###### Inherited from
2359
-
2360
- [`AddPhoneCalendarParams`](doubao-apps-sdk-open-api.md#addphonecalendarparams).[`title`](doubao-apps-sdk-open-api.md#title)
2361
-
2362
- ***
2363
-
2364
- ### AppBaseInfoHost
2365
-
2366
- #### Properties
2367
-
2368
- ##### appId
2369
-
2370
- > **appId**: `string`
2371
-
2372
- 宿主 app 对应的 appId
2373
-
2374
- ***
2375
-
2376
- ### AuthorizeRequest
2377
-
2378
- #### Properties
2379
-
2380
- ##### scope
2381
-
2382
- > **scope**: [`Scope`](doubao-apps-sdk-open-api.md#scope-1)
2383
-
2384
- 授权范围
2385
-
2386
- ***
2387
-
2388
- ### BeaconInfo
2389
-
2390
- iBeacon 设备信息。
2391
-
2392
- #### Properties
2393
-
2394
- ##### accuracy
2395
-
2396
- > **accuracy**: `number`
2397
-
2398
- 距离,单位米。
2399
-
2400
- ##### major
2401
-
2402
- > **major**: `string`
2403
-
2404
- 主 ID。
2405
-
2406
- ##### minor
2407
-
2408
- > **minor**: `string`
2409
-
2410
- 次 ID。
2411
-
2412
- ##### proximity
2413
-
2414
- > **proximity**: [`BeaconProximity`](doubao-apps-sdk-open-api.md#beaconproximity)
2415
-
2416
- 距离等级。
2417
-
2418
- ##### rssi
2419
-
2420
- > **rssi**: `number`
2421
-
2422
- RSSI 信号强度,单位 dBm。
2423
-
2424
- ##### uuid
2425
-
2426
- > **uuid**: `string`
2427
-
2428
- Beacon UUID。
2429
-
2430
- ***
2431
-
2432
- ### BluetoothCharacteristic
2433
-
2434
- 蓝牙特征值信息。
2435
-
2436
- #### Properties
2437
-
2438
- ##### properties
2439
-
2440
- > **properties**: [`BluetoothCharacteristicProperties`](doubao-apps-sdk-open-api.md#bluetoothcharacteristicproperties)
2441
-
2442
- 特征值能力。
2443
-
2444
- ##### uuid
2445
-
2446
- > **uuid**: `string`
2447
-
2448
- 特征值 UUID。
2449
-
2450
- ***
2451
-
2452
- ### BluetoothCharacteristicProperties
2453
-
2454
- 蓝牙特征值支持的能力。
2455
-
2456
- #### Properties
2457
-
2458
- ##### indicate
2459
-
2460
- > **indicate**: `boolean`
2461
-
2462
- 是否支持 indicate。
2463
-
2464
- ##### notify
2465
-
2466
- > **notify**: `boolean`
2467
-
2468
- 是否支持 notify。
2469
-
2470
- ##### read
2471
-
2472
- > **read**: `boolean`
2473
-
2474
- 是否支持 read。
2475
-
2476
- ##### write
2477
-
2478
- > **write**: `boolean`
2479
-
2480
- 是否支持 write。
2481
-
2482
- ##### writeDefault
2483
-
2484
- > **writeDefault**: `boolean`
2485
-
2486
- 是否支持带响应写入。
2487
-
2488
- ##### writeNoResponse
2489
-
2490
- > **writeNoResponse**: `boolean`
2491
-
2492
- 是否支持无响应写入。
2493
-
2494
- ***
2495
-
2496
- ### BluetoothDevice
2497
-
2498
- 蓝牙设备信息。
2499
-
2500
- #### Properties
2501
-
2502
- ##### advertisingData
2503
-
2504
- > **advertisingData**: `ArrayBuffer`
2505
-
2506
- 广播二进制数据。
2507
-
2508
- ##### advertisingServiceUuids
2509
-
2510
- > **advertisingServiceUuids**: `string`[]
2511
-
2512
- 广播中的服务 UUID 列表。
2513
-
2514
- ##### connectable?
2515
-
2516
- > `optional` **connectable**: `boolean`
2517
-
2518
- 是否可连接。
2519
-
2520
- ##### deviceId
2521
-
2522
- > **deviceId**: `string`
2523
-
2524
- 设备 ID。
2525
-
2526
- ##### localName
2527
-
2528
- > **localName**: `string`
2529
-
2530
- 广播中的本地名称。
2531
-
2532
- ##### name
2533
-
2534
- > **name**: `string`
2535
-
2536
- 设备名称。
2537
-
2538
- ##### rssi
2539
-
2540
- > **rssi**: `number`
2541
-
2542
- RSSI 信号强度,单位 dBm。
2543
-
2544
- ##### serviceData
2545
-
2546
- > **serviceData**: `Record`\<`string`, `unknown`\>
2547
-
2548
- 广播中的服务数据。
2549
-
2550
- ***
2551
-
2552
- ### BluetoothService
2553
-
2554
- 蓝牙服务信息。
2555
-
2556
- #### Properties
2557
-
2558
- ##### isPrimary
2559
-
2560
- > **isPrimary**: `boolean`
2561
-
2562
- 是否为主服务。
2563
-
2564
- ##### uuid
2565
-
2566
- > **uuid**: `string`
2567
-
2568
- 服务 UUID。
2569
-
2570
- ***
2571
-
2572
- ### CanIUseParams
2573
-
2574
- #### Properties
2575
-
2576
- ##### schema
2577
-
2578
- > **schema**: `string`
2579
-
2580
- ***
2581
-
2582
- ### CanIUseResult
2583
-
2584
- #### Properties
2585
-
2586
- ##### result
2587
-
2588
- > **result**: `boolean`
2589
-
2590
- ***
2591
-
2592
- ### CheckIsOpenAccessibilityResult
2593
-
2594
- 无障碍能力检测结果。
2595
-
2596
- #### Properties
2597
-
2598
- ##### open
2599
-
2600
- > **open**: `boolean`
2601
-
2602
- 是否开启视觉无障碍能力。
2603
-
2604
- ***
2605
-
2606
- ### ChooseContactResult
2607
-
2608
- 选取联系人后的返回结果。
2609
-
2610
- #### Properties
2611
-
2612
- ##### displayName
2613
-
2614
- > **displayName**: `string`
2615
-
2616
- 联系人名称。
2617
-
2618
- ##### phoneNumber
2619
-
2620
- > **phoneNumber**: `string`
2621
-
2622
- 选中的手机号。
2623
-
2624
- ##### phoneNumberList
2625
-
2626
- > **phoneNumberList**: `string`[]
2627
-
2628
- 联系人所有手机号。
2629
-
2630
- ***
2631
-
2632
- ### CloseBLEConnectionParams
2633
-
2634
- 关闭 BLE 连接的请求参数。
2635
-
2636
- #### Properties
2637
-
2638
- ##### deviceId
2639
-
2640
- > **deviceId**: `string`
2641
-
2642
- 蓝牙设备 ID。
2643
-
2644
- ***
2645
-
2646
- ### CloseParams
2647
-
2648
- #### Properties
2649
-
2650
- ##### containerID?
2651
-
2652
- > `optional` **containerID**: `string`
2653
-
2654
- 指定一个要关闭的页面
2655
-
2656
- ***
2657
-
2658
- ### ConnectWifiParams
2659
-
2660
- 连接 Wi-Fi 的请求参数。
2661
-
2662
- #### Properties
2663
-
2664
- ##### bssid?
2665
-
2666
- > `optional` **bssid**: `string`
2667
-
2668
- Wi-Fi BSSID。
2669
-
2670
- ##### manual?
2671
-
2672
- > `optional` **manual**: `boolean`
2673
-
2674
- 是否跳转到系统设置页连接。
2675
-
2676
- ##### partialInfo?
2677
-
2678
- > `optional` **partialInfo**: `boolean`
2679
-
2680
- 是否仅返回部分 Wi-Fi 信息。
2681
-
2682
- ##### password
2683
-
2684
- > **password**: `string`
2685
-
2686
- Wi-Fi 密码。
2687
-
2688
- ##### ssid
2689
-
2690
- > **ssid**: `string`
2691
-
2692
- Wi-Fi SSID。
2693
-
2694
- ***
2695
-
2696
- ### ConnectedBluetoothDevice
2697
-
2698
- 已连接蓝牙设备信息。
2699
-
2700
- #### Properties
2701
-
2702
- ##### deviceId
2703
-
2704
- > **deviceId**: `string`
2705
-
2706
- 设备 ID。
2707
-
2708
- ##### name
2709
-
2710
- > **name**: `string`
2711
-
2712
- 设备名称。
2713
-
2714
- ***
2715
-
2716
- ### CreateBLEConnectionParams
2717
-
2718
- 创建 BLE 连接的请求参数。
2719
-
2720
- #### Properties
2721
-
2722
- ##### deviceId
2723
-
2724
- > **deviceId**: `string`
2725
-
2726
- 蓝牙设备 ID。
2727
-
2728
- ##### timeout?
2729
-
2730
- > `optional` **timeout**: `number`
2731
-
2732
- 超时时间,单位毫秒。
2733
-
2734
- ***
2735
-
2736
- ### DoubaoAppAccountInfo
2737
-
2738
- 豆包 App 账号信息。
2739
-
2740
- #### Properties
2741
-
2742
- ##### appId
2743
-
2744
- > **appId**: `string`
2745
-
2746
- 豆包 App appId
2747
-
2748
- ##### envVersion
2749
-
2750
- > **envVersion**: `"develop"` \| `"trial"` \| `"release"`
2751
-
2752
- 豆包 App 运行环境。
2753
-
2754
- - develop: 开发版
2755
- - trial: 体验版
2756
- - release: 正式版
2757
-
2758
- ##### version
2759
-
2760
- > **version**: `string`
2761
-
2762
- 线上豆包 App 版本号。
2763
-
2764
- ***
2765
-
2766
- ### GetAccountInfoResult
2767
-
2768
- 获取当前账号信息。
2769
-
2770
- #### Properties
2771
-
2772
- ##### miniProgram
2773
-
2774
- > **miniProgram**: [`DoubaoAppAccountInfo`](doubao-apps-sdk-open-api.md#doubaoappaccountinfo)
2775
-
2776
- 豆包 App账号信息
2777
-
2778
- ##### plugin?
2779
-
2780
- > `optional` **plugin**: [`PluginAccountInfo`](doubao-apps-sdk-open-api.md#pluginaccountinfo)
2781
-
2782
- 插件账号信息(仅在插件中调用时包含)
2783
-
2784
- ***
2785
-
2786
- ### GetAppBaseInfoResult
2787
-
2788
- #### Properties
2789
-
2790
- ##### SDKVersion?
2791
-
2792
- > `optional` **SDKVersion**: `string`
2793
-
2794
- 客户端基础库版本
2795
-
2796
- ##### enableDebug?
2797
-
2798
- > `optional` **enableDebug**: `boolean`
2799
-
2800
- 是否已打开调试
2801
-
2802
- ##### host?
2803
-
2804
- > `optional` **host**: [`AppBaseInfoHost`](doubao-apps-sdk-open-api.md#appbaseinfohost)
2805
-
2806
- 当前豆包 App运行的宿主环境
2807
-
2808
- ##### language
2809
-
2810
- > **language**: `string`
2811
-
2812
- 当前语言
2813
-
2814
- ##### theme?
2815
-
2816
- > `optional` **theme**: `"light"` \| `"dark"`
2817
-
2818
- 当前主题
2819
-
2820
- ##### version?
2821
-
2822
- > `optional` **version**: `string`
2823
-
2824
- 宿主版本号
2825
-
2826
- ***
2827
-
2828
- ### GetBLEDeviceCharacteristicsParams
2829
-
2830
- 获取 BLE 特征值列表的请求参数。
2831
-
2832
- #### Properties
2833
-
2834
- ##### deviceId
2835
-
2836
- > **deviceId**: `string`
2837
-
2838
- 蓝牙设备 ID。
2839
-
2840
- ##### serviceId
2841
-
2842
- > **serviceId**: `string`
2843
-
2844
- 服务 ID。
2845
-
2846
- ***
2847
-
2848
- ### GetBLEDeviceCharacteristicsResult
2849
-
2850
- 获取 BLE 特征值列表的返回结果。
2851
-
2852
- #### Properties
2853
-
2854
- ##### characteristics
2855
-
2856
- > **characteristics**: [`BluetoothCharacteristic`](doubao-apps-sdk-open-api.md#bluetoothcharacteristic)[]
2857
-
2858
- 特征值列表。
2859
-
2860
- ***
2861
-
2862
- ### GetBLEDeviceRSSIParams
2863
-
2864
- 获取 BLE RSSI 的请求参数。
2865
-
2866
- #### Properties
2867
-
2868
- ##### deviceId
2869
-
2870
- > **deviceId**: `string`
2871
-
2872
- 蓝牙设备 ID。
2873
-
2874
- ***
2875
-
2876
- ### GetBLEDeviceRSSIResult
2877
-
2878
- 获取 BLE RSSI 的返回结果。
2879
-
2880
- #### Properties
2881
-
2882
- ##### rssi
2883
-
2884
- > **rssi**: `number`
2885
-
2886
- RSSI 信号强度,单位 dBm。
2887
-
2888
- ***
2889
-
2890
- ### GetBLEDeviceServicesParams
2891
-
2892
- 获取 BLE 服务列表的请求参数。
2893
-
2894
- #### Properties
2895
-
2896
- ##### deviceId
2897
-
2898
- > **deviceId**: `string`
2899
-
2900
- 蓝牙设备 ID。
2901
-
2902
- ***
2903
-
2904
- ### GetBLEDeviceServicesResult
2905
-
2906
- 获取 BLE 服务列表的返回结果。
2907
-
2908
- #### Properties
2909
-
2910
- ##### services
2911
-
2912
- > **services**: [`BluetoothService`](doubao-apps-sdk-open-api.md#bluetoothservice)[]
2913
-
2914
- 设备服务列表。
2915
-
2916
- ***
2917
-
2918
- ### GetBLEMTUParams
2919
-
2920
- 获取 BLE MTU 的请求参数。
2921
-
2922
- #### Properties
2923
-
2924
- ##### deviceId
2925
-
2926
- > **deviceId**: `string`
2927
-
2928
- 蓝牙设备 ID。
2929
-
2930
- ##### writeType?
2931
-
2932
- > `optional` **writeType**: [`BluetoothWriteType`](doubao-apps-sdk-open-api.md#bluetoothwritetype)
2933
-
2934
- 写入模式。
2935
-
2936
- ***
2937
-
2938
- ### GetBLEMTUResult
2939
-
2940
- 获取 BLE MTU 的返回结果。
2941
-
2942
- #### Properties
2943
-
2944
- ##### mtu
2945
-
2946
- > **mtu**: `number`
2947
-
2948
- 当前 MTU。
2949
-
2950
- ***
2951
-
2952
- ### GetBatteryInfoResult
2953
-
2954
- 电池信息。
2955
-
2956
- #### Properties
2957
-
2958
- ##### isCharging
2959
-
2960
- > **isCharging**: `boolean`
2961
-
2962
- 是否正在充电。
2963
-
2964
- ##### level
2965
-
2966
- > **level**: `number`
2967
-
2968
- 当前电量,范围 1 - 100。
2969
-
2970
- ***
2971
-
2972
- ### GetBeaconsResult
2973
-
2974
- 获取 iBeacon 列表的返回结果。
2975
-
2976
- #### Properties
2977
-
2978
- ##### beacons
2979
-
2980
- > **beacons**: [`BeaconInfo`](doubao-apps-sdk-open-api.md#beaconinfo)[]
2981
-
2982
- 当前搜到的 iBeacon 列表。
2983
-
2984
- ***
2985
-
2986
- ### GetBluetoothAdapterStateResult
2987
-
2988
- 蓝牙适配器状态。
2989
-
2990
- #### Properties
2991
-
2992
- ##### available
2993
-
2994
- > **available**: `boolean`
2995
-
2996
- 蓝牙适配器是否可用。
2997
-
2998
- ##### discovering
2999
-
3000
- > **discovering**: `boolean`
3001
-
3002
- 是否正在搜索蓝牙设备。
3003
-
3004
- ***
3005
-
3006
- ### GetBluetoothDevicesResult
3007
-
3008
- 获取蓝牙设备列表的返回结果。
3009
-
3010
- #### Properties
3011
-
3012
- ##### devices
3013
-
3014
- > **devices**: [`BluetoothDevice`](doubao-apps-sdk-open-api.md#bluetoothdevice)[]
3015
-
3016
- 当前蓝牙模块已发现的设备列表。
3017
-
3018
- ***
3019
-
3020
- ### GetClipboardDataResult
3021
-
3022
- 剪贴板读取结果。
3023
-
3024
- #### Properties
3025
-
3026
- ##### data
3027
-
3028
- > **data**: `string`
3029
-
3030
- 当前剪贴板内容。
3031
-
3032
- ***
3033
-
3034
- ### GetConnectedBluetoothDevicesParams
3035
-
3036
- 获取已连接蓝牙设备的请求参数。
3037
-
3038
- #### Properties
3039
-
3040
- ##### services
3041
-
3042
- > **services**: `string`[]
3043
-
3044
- 蓝牙主服务 UUID 列表。
3045
-
3046
- ***
3047
-
3048
- ### GetConnectedBluetoothDevicesResult
3049
-
3050
- 获取已连接蓝牙设备的返回结果。
3051
-
3052
- #### Properties
3053
-
3054
- ##### devices
3055
-
3056
- > **devices**: [`ConnectedBluetoothDevice`](doubao-apps-sdk-open-api.md#connectedbluetoothdevice)[]
3057
-
3058
- 已连接设备列表。
3059
-
3060
- ***
3061
-
3062
- ### GetConnectedWifiParams
3063
-
3064
- 获取当前已连接 Wi-Fi 的请求参数。
3065
-
3066
- #### Properties
3067
-
3068
- ##### partialInfo?
3069
-
3070
- > `optional` **partialInfo**: `boolean`
3071
-
3072
- 是否只返回部分 Wi-Fi 信息。
3073
-
3074
- ***
3075
-
3076
- ### GetConnectedWifiResult
3077
-
3078
- 获取当前已连接 Wi-Fi 的返回结果。
3079
-
3080
- #### Properties
3081
-
3082
- ##### wifi
3083
-
3084
- > **wifi**: [`WifiInfo`](doubao-apps-sdk-open-api.md#wifiinfo)
3085
-
3086
- 当前连接的 Wi-Fi 信息。
3087
-
3088
- ***
3089
-
3090
- ### GetLocalIPAddressResult
3091
-
3092
- 获取局域网 IP 的返回结果。
3093
-
3094
- #### Properties
3095
-
3096
- ##### localIp
3097
-
3098
- > **localIp**: `string`
3099
-
3100
- 本机局域网 IP 地址。
3101
-
3102
- ##### netmask?
3103
-
3104
- > `optional` **netmask**: `string`
3105
-
3106
- 子网掩码。
3107
-
3108
- ***
3109
-
3110
- ### GetLocationParams
3111
-
3112
- #### Properties
3113
-
3114
- ##### maxCacheMs?
3115
-
3116
- > `optional` **maxCacheMs**: `number`
3117
-
3118
- 缓存时间,单位毫秒,默认为0
3119
-
3120
- ##### mode?
3121
-
3122
- > `optional` **mode**: `number`
3123
-
3124
- 定位模式
3125
- 0:低功耗
3126
- 1:仅设备
3127
- 2:高精度(默认)
3128
-
3129
- ##### source?
3130
-
3131
- > `optional` **source**: `string`
3132
-
3133
- 调用业务方
3134
-
3135
- ##### timeoutMs?
3136
-
3137
- > `optional` **timeoutMs**: `number`
3138
-
3139
- 超时时间,单位毫秒,默认 30000
3140
-
3141
- ***
3142
-
3143
- ### GetLocationResponse
3144
-
3145
- #### Properties
3146
-
3147
- ##### accuracy
3148
-
3149
- > **accuracy**: `number`
3150
-
3151
- 定位精度,单位:米
3152
-
3153
- ##### latitude
3154
-
3155
- > **latitude**: `number`
3156
-
3157
- 纬度
3158
-
3159
- ##### longitude
3160
-
3161
- > **longitude**: `number`
3162
-
3163
- 经度
3164
-
3165
- ##### speed
3166
-
3167
- > **speed**: `number`
3168
-
3169
- 行进速度,单位:米/秒
3170
-
3171
- ##### timestamp
3172
-
3173
- > **timestamp**: `string`
3174
-
3175
- 时间戳
3176
-
3177
- ***
3178
-
3179
- ### GetNetworkTypeParams
3180
-
3181
- 获取网络类型的请求参数。
3182
-
3183
- 当前无需传入任何字段,预留扩展位。
3184
-
3185
- ***
3186
-
3187
- ### GetNetworkTypeResult
3188
-
3189
- 获取网络类型的返回结果。
3190
-
3191
- #### Properties
3192
-
3193
- ##### hasSystemProxy?
3194
-
3195
- > `optional` **hasSystemProxy**: `boolean`
3196
-
3197
- 设备是否使用了系统代理。
3198
-
3199
- ##### networkType
3200
-
3201
- > **networkType**: [`NetworkType`](doubao-apps-sdk-open-api.md#networktype-1)
3202
-
3203
- 当前网络类型。
3204
-
3205
- ##### signalStrength?
3206
-
3207
- > `optional` **signalStrength**: `number`
3208
-
3209
- 信号强弱,单位 dBm。
3210
-
3211
- ##### weakNet?
3212
-
3213
- > `optional` **weakNet**: `boolean`
3214
-
3215
- 是否处于弱网环境。
3216
-
3217
- ***
3218
-
3219
- ### GetOrderPaymentParams
3220
-
3221
- #### Properties
3222
-
3223
- ##### orderId
3224
-
3225
- > **orderId**: `string`
3226
-
3227
- ***
3228
-
3229
- ### GetOrderPaymentResult
3230
-
3231
- #### Properties
3232
-
3233
- ##### logId
3234
-
3235
- > **logId**: `string`
3236
-
3237
- ##### orderId
3238
-
3239
- > **orderId**: `string`
3240
-
3241
- ***
3242
-
3243
- ### GetRandomValuesParams
3244
-
3245
- 获取安全随机数的请求参数。
3246
-
3247
- #### Properties
3248
-
3249
- ##### length
3250
-
3251
- > **length**: `number`
3252
-
3253
- 需要生成的字节数。
3254
-
3255
- ***
3256
-
3257
- ### GetRandomValuesResult
3258
-
3259
- 获取安全随机数的返回结果。
3260
-
3261
- #### Properties
3262
-
3263
- ##### randomValues
3264
-
3265
- > **randomValues**: `ArrayBuffer`
3266
-
3267
- 生成的随机字节。
3268
-
3269
- ***
3270
-
3271
- ### GetScreenBrightnessResult
3272
-
3273
- #### Properties
3274
-
3275
- ##### value
3276
-
3277
- > **value**: `number`
3278
-
3279
- 屏幕亮度值,范围 0 ~ 1,0 最暗,1 最亮
3280
-
3281
- ***
3282
-
3283
- ### GetSelectedTextRangeResult
3284
-
3285
- 获取输入框选区范围的返回结果。
3286
-
3287
- #### Properties
3288
-
3289
- ##### end
3290
-
3291
- > **end**: `number`
3292
-
3293
- 选区结束位置。
3294
-
3295
- ##### start
3296
-
3297
- > **start**: `number`
3298
-
3299
- 选区起始位置。
3300
-
3301
- ***
3302
-
3303
- ### GetStorageInfoResult
3304
-
3305
- #### Properties
3306
-
3307
- ##### currentSize
3308
-
3309
- > **currentSize**: `number`
3310
-
3311
- 当前占用的空间大小,单位 KB
3312
-
3313
- ##### keys
3314
-
3315
- > **keys**: `string`[]
3316
-
3317
- 当前 storage 中所有的 key
3318
-
3319
- ##### limitSize
3320
-
3321
- > **limitSize**: `number`
3322
-
3323
- 限制的空间大小,单位 KB
3324
-
3325
- ***
3326
-
3327
- ### GetStorageParams
3328
-
3329
- #### Properties
3330
-
3331
- ##### key
3332
-
3333
- > **key**: `string`
3334
-
3335
- 本地缓存键名
3336
-
3337
- ***
3338
-
3339
- ### GetStorageResult\<TData\>
3340
-
3341
- #### Type parameters
3342
-
3343
- • **TData** = `unknown`
3344
-
3345
- #### Properties
3346
-
3347
- ##### data
3348
-
3349
- > **data**: `TData`
3350
-
3351
- key 对应的数据
3352
-
3353
- ***
3354
-
3355
- ### GetWifiListResult
3356
-
3357
- 获取 Wi-Fi 列表的返回结果。
3358
-
3359
- #### Properties
3360
-
3361
- ##### wifiList
3362
-
3363
- > **wifiList**: [`WifiInfo`](doubao-apps-sdk-open-api.md#wifiinfo)[]
3364
-
3365
- 当前获取到的 Wi-Fi 列表。
3366
-
3367
- ***
3368
-
3369
- ### GetWindowInfoResult
3370
-
3371
- #### Properties
3372
-
3373
- ##### pixelRatio
3374
-
3375
- > **pixelRatio**: `number`
3376
-
3377
- 设备像素比
3378
-
3379
- ##### safeArea?
3380
-
3381
- > `optional` **safeArea**: [`WindowSafeArea`](doubao-apps-sdk-open-api.md#windowsafearea)
3382
-
3383
- 安全区域
3384
-
3385
- ##### screenHeight
3386
-
3387
- > **screenHeight**: `number`
3388
-
3389
- 屏幕高度
3390
-
3391
- ##### screenTop
3392
-
3393
- > **screenTop**: `number`
3394
-
3395
- 窗口上边缘的 y 值
3396
-
3397
- ##### screenWidth
3398
-
3399
- > **screenWidth**: `number`
3400
-
3401
- 屏幕宽度
3402
-
3403
- ##### statusBarHeight
3404
-
3405
- > **statusBarHeight**: `number`
3406
-
3407
- 状态栏高度
3408
-
3409
- ##### windowHeight
3410
-
3411
- > **windowHeight**: `number`
3412
-
3413
- 可使用窗口高度
3414
-
3415
- ##### windowWidth
3416
-
3417
- > **windowWidth**: `number`
3418
-
3419
- 可使用窗口宽度
3420
-
3421
- ***
3422
-
3423
- ### IsBluetoothDevicePairedParams
3424
-
3425
- 查询蓝牙设备配对状态的请求参数。
3426
-
3427
- #### Properties
3428
-
3429
- ##### deviceId
3430
-
3431
- > **deviceId**: `string`
3432
-
3433
- 蓝牙设备 ID。
3434
-
3435
- ***
3436
-
3437
- ### KeyboardHeightChangeEvent
3438
-
3439
- #### Properties
3440
-
3441
- ##### height
3442
-
3443
- > **height**: `number`
3444
-
3445
- 键盘高度,单位 px。
3446
-
3447
- ***
3448
-
3449
- ### LoginRequest
3450
-
3451
- #### Properties
3452
-
3453
- ##### timeout?
3454
-
3455
- > `optional` **timeout**: `number`
3456
-
3457
- Timeout in milliseconds
3458
-
3459
- ***
3460
-
3461
- ### LoginResult
3462
-
3463
- #### Properties
3464
-
3465
- ##### code
3466
-
3467
- > **code**: `string`
3468
-
3469
- Login credential code
3470
-
3471
- ***
3472
-
3473
- ### LoginWithWidgetRequest
3474
-
3475
- #### Properties
3476
-
3477
- ##### loginType
3478
-
3479
- > **loginType**: `LoginType`
3480
-
3481
- Login type identifier
3482
-
3483
- ***
3484
-
3485
- ### LoginWithWidgetResult
3486
-
3487
- #### Properties
3488
-
3489
- ##### result
3490
-
3491
- > **result**: `boolean`
3492
-
3493
- Whether the login is successful
3494
-
3495
- ***
3496
-
3497
- ### MakeBluetoothPairParams
3498
-
3499
- 蓝牙配对请求参数。
3500
-
3501
- #### Properties
3502
-
3503
- ##### deviceId
3504
-
3505
- > **deviceId**: `string`
3506
-
3507
- 蓝牙设备 ID。
3508
-
3509
- ##### pin
3510
-
3511
- > **pin**: `string`
3512
-
3513
- 配对 PIN 码。
3514
-
3515
- ##### timeout?
3516
-
3517
- > `optional` **timeout**: `number`
3518
-
3519
- 超时时间,单位毫秒。
3520
-
3521
- ***
3522
-
3523
- ### MakePhoneCallParams
3524
-
3525
- #### Properties
3526
-
3527
- ##### phoneNumber
3528
-
3529
- > **phoneNumber**: `string`
3530
-
3531
- 需要拨打的电话号码
3532
-
3533
- ***
3534
-
3535
- ### NavigateBackParams
3536
-
3537
- #### Properties
3538
-
3539
- ##### delta?
3540
-
3541
- > `optional` **delta**: `number`
3542
-
3543
- 返回的页面数,如果 delta 大于现有页面数,则返回到页面栈中只剩一个页面为止。
3544
-
3545
- ***
3546
-
3547
- ### NavigateToParams
3548
-
3549
- #### Properties
3550
-
3551
- ##### url
3552
-
3553
- > **url**: `string`
3554
-
3555
- 跳转的页面的路径,如 'path?key=value&key2=value2'
3556
-
3557
- ***
3558
-
3559
- ### NotifyBLECharacteristicValueChangeParams
3560
-
3561
- 订阅 BLE 特征值变化的请求参数。
3562
-
3563
- #### Properties
3564
-
3565
- ##### characteristicId
3566
-
3567
- > **characteristicId**: `string`
3568
-
3569
- 特征值 ID。
3570
-
3571
- ##### deviceId
3572
-
3573
- > **deviceId**: `string`
3574
-
3575
- 蓝牙设备 ID。
3576
-
3577
- ##### serviceId
3578
-
3579
- > **serviceId**: `string`
3580
-
3581
- 服务 ID。
3582
-
3583
- ##### state
3584
-
3585
- > **state**: `boolean`
3586
-
3587
- 是否启用订阅。
3588
-
3589
- ##### type?
3590
-
3591
- > `optional` **type**: [`BluetoothNotifyType`](doubao-apps-sdk-open-api.md#bluetoothnotifytype)
3592
-
3593
- 订阅类型。
3594
-
3595
- ***
3596
-
3597
- ### OpenAppRequest
3598
-
3599
- #### Properties
3600
-
3601
- ##### fallbackUrl?
3602
-
3603
- > `optional` **fallbackUrl**: `string`
3604
-
3605
- Optional fallback URL when deep link fails
3606
-
3607
- ##### targetPackage?
3608
-
3609
- > `optional` **targetPackage**: `string`
3610
-
3611
- Optional target package name for Android
3612
-
3613
- ##### uri
3614
-
3615
- > **uri**: `string`
3616
-
3617
- Target URI to open, e.g. scheme://path?query
3618
-
3619
- ***
3620
-
3621
- ### OpenAppResult
3622
-
3623
- #### Properties
3624
-
3625
- ##### status
3626
-
3627
- > **status**: [`OpenAppStatus`](doubao-apps-sdk-open-api.md#openappstatus)
3628
-
3629
- Execution status from client
3630
-
3631
- ***
3632
-
3633
- ### OpenBluetoothAdapterParams
3634
-
3635
- 打开蓝牙适配器的请求参数。
3636
-
3637
- #### Properties
3638
-
3639
- ##### mode?
3640
-
3641
- > `optional` **mode**: [`BluetoothAdapterMode`](doubao-apps-sdk-open-api.md#bluetoothadaptermode)
3642
-
3643
- 蓝牙模式。
3644
-
3645
- ***
3646
-
3647
- ### PluginAccountInfo
3648
-
3649
- 插件账号信息(仅在插件中调用时包含)。
3650
-
3651
- #### Properties
3652
-
3653
- ##### appId
3654
-
3655
- > **appId**: `string`
3656
-
3657
- 插件 appId
3658
-
3659
- ##### version
3660
-
3661
- > **version**: `string`
3662
-
3663
- 插件版本号,'a.b.c' 形式
3664
-
3665
- ***
3666
-
3667
- ### PostLoginResultRequest
3668
-
3669
- #### Properties
3670
-
3671
- ##### code?
3672
-
3673
- > `optional` **code**: `string`
3674
-
3675
- Authorization login credential, valid when login result is true
3676
-
3677
- ##### result
3678
-
3679
- > **result**: `boolean`
3680
-
3681
- Login result, true means success, false means failure
3682
-
3683
- ***
3684
-
3685
- ### PrivacySettingResult
3686
-
3687
- #### Properties
3688
-
3689
- ##### needAuthorization
3690
-
3691
- > **needAuthorization**: `boolean`
3692
-
3693
- Whether user authorization for privacy agreement is required
3694
-
3695
- ***
3696
-
3697
- ### ReadBLECharacteristicValueParams
3698
-
3699
- 读取 BLE 特征值的请求参数。
3700
-
3701
- #### Properties
3702
-
3703
- ##### characteristicId
3704
-
3705
- > **characteristicId**: `string`
3706
-
3707
- 特征值 ID。
3708
-
3709
- ##### deviceId
3710
-
3711
- > **deviceId**: `string`
3712
-
3713
- 蓝牙设备 ID。
3714
-
3715
- ##### serviceId
3716
-
3717
- > **serviceId**: `string`
3718
-
3719
- 服务 ID。
3720
-
3721
- ***
3722
-
3723
- ### RemoveStorageParams
3724
-
3725
- #### Properties
3726
-
3727
- ##### key
3728
-
3729
- > **key**: `string`
3730
-
3731
- 本地缓存键名
3732
-
3733
- ***
3734
-
3735
- ### RequestOrderParams
3736
-
3737
- #### Properties
3738
-
3739
- ##### data
3740
-
3741
- > **data**: `string`
3742
-
3743
- ##### dbAuthorization
3744
-
3745
- > **dbAuthorization**: `string`
3746
-
3747
- ***
3748
-
3749
- ### RequestOrderResult
3750
-
3751
- #### Properties
3752
-
3753
- ##### logId
3754
-
3755
- > **logId**: `string`
3756
-
3757
- ##### orderId
3758
-
3759
- > **orderId**: `string`
3760
-
3761
- ***
3762
-
3763
- ### RequestParams
3764
-
3765
- 网络请求参数。
3766
-
3767
- #### Properties
3768
-
3769
- ##### data?
3770
-
3771
- > `optional` **data**: `string` \| `ArrayBuffer` \| `Record`\<`string`, `any`\>
3772
-
3773
- 请求体数据。
3774
-
3775
- 传给服务器的数据最终会是 `String` 或 `ArrayBuffer`:
3776
- - 若 `data` 是 `string` 或 `ArrayBuffer`,直接使用;
3777
- - 若 `header['content-type']` 是 `application/x-www-form-urlencoded`,会被编码为 query string,例如:`encodeURIComponent(k)=encodeURIComponent(v)`;
3778
- - 若 `header['content-type']` 是 `application/json`,会执行 JSON 序列化;
3779
- - 若 `data` 是普通对象且未命中上述类型,也会执行 JSON 序列化;
3780
- - 其他类型会调用 `toString()`
3781
-
3782
- ##### dataType?
3783
-
3784
- > `optional` **dataType**: `"string"` \| `"json"`
3785
-
3786
- 期望返回的数据格式。
3787
- - `json`: 尝试按 JSON 解析;
3788
- - `string`: 按字符串返回。
3789
-
3790
- ###### Default
3791
-
3792
- ```ts
3793
- "json"
3794
- ```
3795
-
3796
- ##### header?
3797
-
3798
- > `optional` **header**: `Record`\<`string`, `string`\>
3799
-
3800
- 请求 Header。
3801
-
3802
- ###### Default
3803
-
3804
- ```ts
3805
- {"content-type": "application/json"}
3806
- ```
3807
-
3808
- ##### method?
3809
-
3810
- > `optional` **method**: [`RequestMethod`](doubao-apps-sdk-open-api.md#requestmethod)
3811
-
3812
- 请求方法。
3813
-
3814
- ###### Default
3815
-
3816
- ```ts
3817
- "GET"
3818
- ```
3819
-
3820
- ##### url
3821
-
3822
- > **url**: `string`
3823
-
3824
- 请求地址,需为完整的 **HTTPS** URL。
3825
-
3826
- ***
3827
-
3828
- ### RequestResponse
3829
-
3830
- 网络请求返回结果。
3831
-
3832
- #### Properties
3833
-
3834
- ##### data?
3835
-
3836
- > `optional` **data**: `string` \| `ArrayBuffer` \| `Record`\<`string`, `any`\>
3837
-
3838
- 响应数据,类型由 `dataType` 决定。
3839
-
3840
- ##### header
3841
-
3842
- > **header**: `Record`\<`string`, `string`\>
3843
-
3844
- HTTP 响应头。
3845
-
3846
- ##### statusCode
3847
-
3848
- > **statusCode**: `number`
3849
-
3850
- HTTP 状态码。
3851
-
3852
- ***
3853
-
3854
- ### ScanCodeParams
3855
-
3856
- 扫码请求参数。
3857
-
3858
- #### Properties
3859
-
3860
- ##### onlyFromCamera?
3861
-
3862
- > `optional` **onlyFromCamera**: `boolean`
3863
-
3864
- 是否仅允许从相机扫码。
3865
-
3866
- ##### scanType?
3867
-
3868
- > `optional` **scanType**: [`ScanCodeType`](doubao-apps-sdk-open-api.md#scancodetype)[]
3869
-
3870
- 允许的扫码类型。
3871
-
3872
- ***
3873
-
3874
- ### ScanCodeResult
3875
-
3876
- 扫码返回结果。
3877
-
3878
- #### Properties
3879
-
3880
- ##### characterSet
3881
-
3882
- > **characterSet**: `string`
3883
-
3884
- 字符集。
3885
-
3886
- ##### path
3887
-
3888
- > **path**: `string`
3889
-
3890
- 当前宿主可识别的页面路径。
3891
-
3892
- ##### rawData
3893
-
3894
- > **rawData**: `string`
3895
-
3896
- 原始数据,通常为 Base64 字符串。
3897
-
3898
- ##### result
3899
-
3900
- > **result**: `string`
3901
-
3902
- 扫码结果文本。
3903
-
3904
- ##### scanType
3905
-
3906
- > **scanType**: [`ScanResultType`](doubao-apps-sdk-open-api.md#scanresulttype)
3907
-
3908
- 扫码结果类型。
3909
-
3910
- ***
3911
-
3912
- ### SendHCEMessageParams
3913
-
3914
- 发送 HCE 消息的请求参数。
3915
-
3916
- #### Properties
3917
-
3918
- ##### data
3919
-
3920
- > **data**: `ArrayBuffer`
3921
-
3922
- 要发送的二进制数据。
3923
-
3924
- ***
3925
-
3926
- ### SendQueryMessageParams
3927
-
3928
- #### Properties
3929
-
3930
- ##### content
3931
-
3932
- > **content**: `string`
3933
-
3934
- 要发送的消息。根据类型不同,序列化方式可能不同
3935
-
3936
- ##### type
3937
-
3938
- > **type**: `"text"`
3939
-
3940
- 消息类型,目前仅支持 text
3941
-
3942
- ***
3943
-
3944
- ### SendSmsParams
3945
-
3946
- 拉起系统短信发送面板的请求参数。
3947
-
3948
- #### Properties
3949
-
3950
- ##### message?
3951
-
3952
- > `optional` **message**: `string`
3953
-
3954
- 预填到发送短信面板的内容。
3955
-
3956
- ##### phoneNumber?
3957
-
3958
- > `optional` **phoneNumber**: `string`
3959
-
3960
- 预填到发送短信面板的手机号。
3961
-
3962
- ***
3963
-
3964
- ### SetBLEMTUParams
3965
-
3966
- 设置 BLE MTU 的请求参数。
3967
-
3968
- #### Properties
3969
-
3970
- ##### deviceId
3971
-
3972
- > **deviceId**: `string`
3973
-
3974
- 蓝牙设备 ID。
3975
-
3976
- ##### mtu
3977
-
3978
- > **mtu**: `number`
3979
-
3980
- 目标 MTU。
3981
-
3982
- ***
3983
-
3984
- ### SetBLEMTUResult
3985
-
3986
- 设置 BLE MTU 的返回结果。
3987
-
3988
- #### Properties
3989
-
3990
- ##### mtu
3991
-
3992
- > **mtu**: `string` \| `number`
3993
-
3994
- 最终协商得到的 MTU。
3995
-
3996
- ***
3997
-
3998
- ### SetClipboardDataParams
3999
-
4000
- #### Properties
4001
-
4002
- ##### data
4003
-
4004
- > **data**: `string`
4005
-
4006
- 需要设置的剪贴板内容
4007
-
4008
- ***
4009
-
4010
- ### SetKeepScreenOnParams
4011
-
4012
- 设置屏幕常亮的请求参数。
4013
-
4014
- #### Properties
4015
-
4016
- ##### keepScreenOn
4017
-
4018
- > **keepScreenOn**: `boolean`
4019
-
4020
- 是否保持屏幕常亮。
4021
-
4022
- ***
4023
-
4024
- ### SetScreenBrightnessParams
4025
-
4026
- 设置屏幕亮度的请求参数。
4027
-
4028
- #### Properties
4029
-
4030
- ##### value
4031
-
4032
- > **value**: `number`
4033
-
4034
- 屏幕亮度值,范围 0 ~ 1。
4035
-
4036
- ***
4037
-
4038
- ### SetStorageParams\<TData\>
4039
-
4040
- #### Type parameters
4041
-
4042
- • **TData** = `unknown`
4043
-
4044
- #### Properties
4045
-
4046
- ##### data
4047
-
4048
- > **data**: `TData`
4049
-
4050
- 待存储的数据
4051
-
4052
- ##### key
4053
-
4054
- > **key**: `string`
4055
-
4056
- 本地缓存键名
4057
-
4058
- ***
4059
-
4060
- ### SetVisualEffectOnCaptureParams
4061
-
4062
- 设置截屏或录屏视觉效果的请求参数。
4063
-
4064
- #### Properties
4065
-
4066
- ##### visualEffect?
4067
-
4068
- > `optional` **visualEffect**: [`CaptureVisualEffect`](doubao-apps-sdk-open-api.md#capturevisualeffect)
4069
-
4070
- 截屏或录屏时的视觉表现。
4071
-
4072
- ***
4073
-
4074
- ### SetWifiListParams
4075
-
4076
- 设置 Wi-Fi 预设列表的请求参数。
4077
-
4078
- #### Properties
4079
-
4080
- ##### wifiList
4081
-
4082
- > **wifiList**: [`WifiListItem`](doubao-apps-sdk-open-api.md#wifilistitem)[]
4083
-
4084
- 预设的 Wi-Fi 列表。
4085
-
4086
- ***
4087
-
4088
- ### ShowToastParams
4089
-
4090
- #### Properties
4091
-
4092
- ##### customIcon?
4093
-
4094
- > `optional` **customIcon**: `string`
4095
-
4096
- ##### duration?
4097
-
4098
- > `optional` **duration**: `number`
4099
-
4100
- ##### icon?
4101
-
4102
- > `optional` **icon**: `"success"` \| `"error"` \| `"warn"`
4103
-
4104
- ##### message
4105
-
4106
- > **message**: `string`
4107
-
4108
- ##### type?
4109
-
4110
- > `optional` **type**: `"default"` \| `"success"` \| `"error"` \| `"warning"`
4111
-
4112
- ***
4113
-
4114
- ### StartAccelerometerParams
4115
-
4116
- 开始监听加速度的请求参数。
4117
-
4118
- #### Properties
4119
-
4120
- ##### interval?
4121
-
4122
- > `optional` **interval**: [`SensorInterval`](doubao-apps-sdk-open-api.md#sensorinterval)
4123
-
4124
- 监听频率。
4125
-
4126
- ***
4127
-
4128
- ### StartBeaconDiscoveryParams
4129
-
4130
- 开始搜索 iBeacon 的请求参数。
4131
-
4132
- #### Properties
4133
-
4134
- ##### ignoreBluetoothAvailable?
4135
-
4136
- > `optional` **ignoreBluetoothAvailable**: `boolean`
4137
-
4138
- iOS 下是否忽略蓝牙可用性校验。
4139
-
4140
- ##### uuids
4141
-
4142
- > **uuids**: `string`[]
4143
-
4144
- 要搜索的 iBeacon UUID 列表。
4145
-
4146
- ***
4147
-
4148
- ### StartBluetoothDevicesDiscoveryParams
4149
-
4150
- 开始搜索蓝牙设备的请求参数。
4151
-
4152
- #### Properties
4153
-
4154
- ##### allowDuplicatesKey?
4155
-
4156
- > `optional` **allowDuplicatesKey**: `boolean`
4157
-
4158
- 是否允许重复上报同一设备。
4159
-
4160
- ##### interval?
4161
-
4162
- > `optional` **interval**: `number`
4163
-
4164
- 上报设备的间隔,单位毫秒。
4165
-
4166
- ##### powerLevel?
4167
-
4168
- > `optional` **powerLevel**: [`BluetoothPowerLevel`](doubao-apps-sdk-open-api.md#bluetoothpowerlevel)
4169
-
4170
- 扫描功耗等级。
4171
-
4172
- ##### services?
4173
-
4174
- > `optional` **services**: `string`[]
4175
-
4176
- 按主服务 UUID 过滤搜索范围。
4177
-
4178
- ***
4179
-
4180
- ### StartDeviceMotionListeningParams
4181
-
4182
- 开始监听设备方向变化的请求参数。
4183
-
4184
- #### Properties
4185
-
4186
- ##### interval?
4187
-
4188
- > `optional` **interval**: [`SensorInterval`](doubao-apps-sdk-open-api.md#sensorinterval)
4189
-
4190
- 监听频率。
4191
-
4192
- ***
4193
-
4194
- ### StartGyroscopeParams
4195
-
4196
- 开始监听陀螺仪的请求参数。
4197
-
4198
- #### Properties
4199
-
4200
- ##### interval?
4201
-
4202
- > `optional` **interval**: [`SensorInterval`](doubao-apps-sdk-open-api.md#sensorinterval)
4203
-
4204
- 监听频率。
4205
-
4206
- ***
4207
-
4208
- ### StartHCEParams
4209
-
4210
- 开启 HCE 的请求参数。
4211
-
4212
- #### Properties
4213
-
4214
- ##### aidList
4215
-
4216
- > **aidList**: `string`[]
4217
-
4218
- 需要注册到系统的 AID 列表。
4219
-
4220
- ***
4221
-
4222
- ### UpdateModelContextEntityBlock
4223
-
4224
- #### Properties
4225
-
4226
- ##### entities
4227
-
4228
- > **entities**: `Record`\<`string`, `any`\>[]
4229
-
4230
- ##### type
4231
-
4232
- > **type**: `"entity"`
4233
-
4234
- ***
4235
-
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
- ```
4279
-
4280
- #### Properties
4281
-
4282
- ##### content?
4283
-
4284
- > `optional` **content**: [`UpdateModelContextBlock`](doubao-apps-sdk-open-api.md#updatemodelcontextblock)[]
4285
-
4286
- blocks 数组,支持 summary/entity 混搭。
4287
- - 顺序不做强约束;建议把 summary 放前面,便于人类阅读。
4288
- - 端侧生成稳定 event_id 时,会从所有 blocks 扫描 type="entity" 的 entities 来提取业务 identity(与顺序无关)。
4289
-
4290
- ##### entity\_meta?
4291
-
4292
- > `optional` **entity\_meta**: `Record`\<`string`, `any`\>
4293
-
4294
- 可选:业务侧补充元信息(如来源、去重锚点、时序、过期策略等)。
4295
-
4296
- 字段示例:
4297
- - mcpServer: 数据来源 app(例如 caocao)
4298
- - create_time: 业务侧数据发生时间(用于时序)
4299
- - expire_at: 业务侧过期时间(过期后模型不再使用;第一期可能未强制生效)
4300
- - update_url: 预留字段(第一期暂不支持)
4301
- - annotation.hostRestartKeep/systemRestartKeep: 预留字段(第一期可能未强制生效)
4302
-
4303
- ***
4304
-
4305
- ### UpdateModelContextSummaryBlock
4306
-
4307
- #### Properties
4308
-
4309
- ##### text
4310
-
4311
- > **text**: `string`
4312
-
4313
- ##### type
4314
-
4315
- > **type**: `"summary"`
4316
-
4317
- ***
4318
-
4319
- ### VibrateShortParams
4320
-
4321
- 短震动请求参数。
4322
-
4323
- #### Properties
4324
-
4325
- ##### type?
4326
-
4327
- > `optional` **type**: [`VibrateShortType`](doubao-apps-sdk-open-api.md#vibrateshorttype)
4328
-
4329
- 震动强度类型。
4330
-
4331
- ***
4332
-
4333
- ### WifiInfo
4334
-
4335
- Wi-Fi 信息。
4336
-
4337
- #### Properties
4338
-
4339
- ##### bssid?
4340
-
4341
- > `optional` **bssid**: `string`
4342
-
4343
- Wi-Fi BSSID。
4344
-
4345
- ##### frequency?
4346
-
4347
- > `optional` **frequency**: `number`
4348
-
4349
- 频段,单位 MHz。
4350
-
4351
- ##### secure?
4352
-
4353
- > `optional` **secure**: `boolean`
4354
-
4355
- Wi-Fi 是否安全。
4356
-
4357
- ##### signalStrength?
4358
-
4359
- > `optional` **signalStrength**: `number`
4360
-
4361
- 信号强度。
4362
-
4363
- ##### ssid
4364
-
4365
- > **ssid**: `string`
4366
-
4367
- Wi-Fi SSID。
4368
-
4369
- ***
4370
-
4371
- ### WifiListItem
4372
-
4373
- 预设 Wi-Fi 条目。
4374
-
4375
- #### Properties
4376
-
4377
- ##### bssid?
4378
-
4379
- > `optional` **bssid**: `string`
4380
-
4381
- Wi-Fi BSSID。
4382
-
4383
- ##### password?
4384
-
4385
- > `optional` **password**: `string`
4386
-
4387
- Wi-Fi 密码。
4388
-
4389
- ##### ssid?
4390
-
4391
- > `optional` **ssid**: `string`
4392
-
4393
- Wi-Fi SSID。
4394
-
4395
- ***
4396
-
4397
- ### WindowSafeArea
4398
-
4399
- #### Properties
4400
-
4401
- ##### bottom
4402
-
4403
- > **bottom**: `number`
4404
-
4405
- 安全区域右下角纵坐标
4406
-
4407
- ##### height
4408
-
4409
- > **height**: `number`
4410
-
4411
- 安全区域高度
4412
-
4413
- ##### left
4414
-
4415
- > **left**: `number`
4416
-
4417
- 安全区域左上角横坐标
4418
-
4419
- ##### right
4420
-
4421
- > **right**: `number`
4422
-
4423
- 安全区域右下角横坐标
4424
-
4425
- ##### top
4426
-
4427
- > **top**: `number`
4428
-
4429
- 安全区域左上角纵坐标
4430
-
4431
- ##### width
4432
-
4433
- > **width**: `number`
4434
-
4435
- 安全区域宽度
4436
-
4437
- ***
4438
-
4439
- ### WriteBLECharacteristicValueParams
4440
-
4441
- 写入 BLE 特征值的请求参数。
4442
-
4443
- #### Properties
4444
-
4445
- ##### characteristicId
4446
-
4447
- > **characteristicId**: `string`
4448
-
4449
- 特征值 ID。
4450
-
4451
- ##### deviceId
4452
-
4453
- > **deviceId**: `string`
4454
-
4455
- 蓝牙设备 ID。
4456
-
4457
- ##### serviceId
4458
-
4459
- > **serviceId**: `string`
4460
-
4461
- 服务 ID。
4462
-
4463
- ##### value
4464
-
4465
- > **value**: `ArrayBuffer`
4466
-
4467
- 要写入的二进制数据。
4468
-
4469
- ##### writeType?
4470
-
4471
- > `optional` **writeType**: [`BluetoothWriteType`](doubao-apps-sdk-open-api.md#bluetoothwritetype)
4472
-
4473
- 写入模式。
4474
-
4475
- ## Type Aliases
4476
-
4477
- ### BeaconProximity
4478
-
4479
- > **BeaconProximity**: `0` \| `1` \| `2` \| `3`
4480
-
4481
- iBeacon 距离等级。
4482
-
4483
- ***
4484
-
4485
- ### BluetoothAdapterMode
4486
-
4487
- > **BluetoothAdapterMode**: `"central"` \| `"peripheral"`
4488
-
4489
- 蓝牙适配器模式。
4490
-
4491
- ***
4492
-
4493
- ### BluetoothNotifyType
4494
-
4495
- > **BluetoothNotifyType**: `"notification"` \| `"indication"`
4496
-
4497
- 蓝牙特征值订阅类型。
4498
-
4499
- ***
4500
-
4501
- ### BluetoothPowerLevel
4502
-
4503
- > **BluetoothPowerLevel**: `"low"` \| `"medium"` \| `"high"`
4504
-
4505
- 蓝牙扫描功耗等级。
4506
-
4507
- ***
4508
-
4509
- ### BluetoothWriteType
4510
-
4511
- > **BluetoothWriteType**: `"write"` \| `"writeNoResponse"`
4512
-
4513
- 蓝牙写入模式。
4514
-
4515
- ***
4516
-
4517
- ### CalendarRepeatInterval
4518
-
4519
- > **CalendarRepeatInterval**: `"day"` \| `"week"` \| `"month"` \| `"year"`
4520
-
4521
- 日历重复周期。
4522
-
4523
- ***
4524
-
4525
- ### CaptureVisualEffect
4526
-
4527
- > **CaptureVisualEffect**: `"none"` \| `"hidden"`
4528
-
4529
- 录屏或截屏时的视觉表现。
4530
-
4531
- ***
4532
-
4533
- ### NetworkType
4534
-
4535
- > **NetworkType**: `"wifi"` \| `"2g"` \| `"3g"` \| `"4g"` \| `"5g"` \| `"unknown"` \| `"none"`
4536
-
4537
- 网络类型。
4538
-
4539
- - `wifi` - Wi-Fi 网络
4540
- - `2g` - 2G 网络
4541
- - `3g` - 3G 网络
4542
- - `4g` - 4G 网络
4543
- - `5g` - 5G 网络
4544
- - `unknown` - Android 下不常见的网络类型
4545
- - `none` - 无网络
4546
-
4547
- ***
4548
-
4549
- ### OpenAppStatus
4550
-
4551
- > **OpenAppStatus**: `"deep_link"` \| `"market"` \| `"browser"`
4552
-
4553
- ***
4554
-
4555
- ### RequestMethod
4556
-
4557
- > **RequestMethod**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"HEAD"` \| `"OPTIONS"` \| `"TRACE"` \| `"CONNECT"`
4558
-
4559
- ***
4560
-
4561
- ### ScanCodeType
4562
-
4563
- > **ScanCodeType**: `"barCode"` \| `"qrCode"` \| `"datamatrix"` \| `"pdf417"`
4564
-
4565
- 扫码类型。
4566
-
4567
- ***
4568
-
4569
- ### ScanResultType
4570
-
4571
- > **ScanResultType**: `"QR_CODE"` \| `"AZTEC"` \| `"CODABAR"` \| `"CODE_39"` \| `"CODE_93"` \| `"CODE_128"` \| `"DATA_MATRIX"` \| `"EAN_8"` \| `"EAN_13"` \| `"ITF"` \| `"MAXICODE"` \| `"PDF_417"` \| `"RSS_14"` \| `"RSS_EXPANDED"` \| `"UPC_A"` \| `"UPC_E"` \| `"UPC_EAN_EXTENSION"` \| `"WX_CODE"` \| `"CODE_25"`
4572
-
4573
- 扫码结果类型。
4574
-
4575
- ***
4576
-
4577
- ### Scope
4578
-
4579
- > **Scope**: `"scope.userLocation"` \| `"scope.userFuzzyLocation"` \| `"scope.userLocationBackground"` \| `"scope.payment"` \| `"scope.record"` \| `"scope.bluetooth"` \| `"scope.camera"` \| `"scope.addPhoneContact"` \| `"scope.addPhoneCalendar"`
4580
-
4581
- ***
4582
-
4583
- ### SensorInterval
295
+ | API | 说明 |
296
+ | --- | --- |
297
+ | [makePhoneCall](open-api/25-设备-电话.md#makephonecall) | 拨打电话。 |
4584
298
 
4585
- > **SensorInterval**: `"game"` \| `"ui"` \| `"normal"`
299
+ ## 设备 / 扫码
4586
300
 
4587
- 传感器监听频率。
301
+ 调起扫码并读取扫码结果。
4588
302
 
4589
- ***
303
+ | API | 说明 |
304
+ | --- | --- |
305
+ | [scanCode](open-api/26-设备-扫码.md#scancode) | 调起扫码能力。 |
4590
306
 
4591
- ### UpdateModelContextBlock
307
+ ## 设备 / 屏幕
4592
308
 
4593
- > **UpdateModelContextBlock**: [`UpdateModelContextSummaryBlock`](doubao-apps-sdk-open-api.md#updatemodelcontextsummaryblock) \| [`UpdateModelContextEntityBlock`](doubao-apps-sdk-open-api.md#updatemodelcontextentityblock)
309
+ 屏幕亮度、常亮和截屏/录屏相关能力。
4594
310
 
4595
- ***
311
+ | API | 说明 |
312
+ | --- | --- |
313
+ | [getScreenBrightness](open-api/27-设备-屏幕.md#getscreenbrightness) | 获取屏幕亮度。 |
314
+ | [setVisualEffectOnCapture](open-api/27-设备-屏幕.md#setvisualeffectoncapture) | 设置截屏或录屏时的视觉表现。<br><br>控制截屏或录屏时的视觉效果。 |
315
+ | [setScreenBrightness](open-api/27-设备-屏幕.md#setscreenbrightness) | 设置屏幕亮度。 |
316
+ | [setKeepScreenOn](open-api/27-设备-屏幕.md#setkeepscreenon) | 设置屏幕常亮状态。 |
317
+ | [onUserCaptureScreen](open-api/27-设备-屏幕.md#onusercapturescreen) | 监听用户主动截屏事件。<br><br>返回取消监听函数。 |
4596
318
 
4597
- ### VibrateShortType
319
+ ## 设备 / 震动
4598
320
 
4599
- > **VibrateShortType**: `"heavy"` \| `"medium"` \| `"light"`
321
+ 触发短震动和长震动。
4600
322
 
4601
- 短震动类型。
323
+ | API | 说明 |
324
+ | --- | --- |
325
+ | [vibrateShort](open-api/28-设备-震动.md#vibrateshort) | 触发短震动。 |
326
+ | [vibrateLong](open-api/28-设备-震动.md#vibratelong) | 触发长震动。 |