@doubao-apps/create 0.0.26 → 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.
- package/dist/36.js +4 -4
- package/dist/template-empty/.ai/examples/common-patterns.md +53 -43
- package/dist/template-empty/.ai/examples/component-basics.md +0 -17
- package/dist/template-empty/.ai/guides/component-development.md +96 -214
- package/dist/template-empty/.ai/guides/system-prompt.md +14 -14
- package/dist/template-empty/.ai/reference/framework-api-quick-ref.md +46 -85
- package/dist/template-empty/.ai/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +13 -13
- package/dist/template-empty/.ai/reference/open-api/{02-storage.md → 02-/345/255/230/345/202/250.md} +13 -21
- package/dist/template-empty/.ai/reference/open-api/{03-router.md → 03-/350/267/257/347/224/261.md} +9 -9
- package/dist/{template-starter/.ai/reference/open-api/04-ui- → template-empty/.ai/reference/open-api/04-/347/225/214/351/235/242-}/344/272/244/344/272/222.md +12 -12
- package/dist/template-empty/.ai/reference/open-api/05-/347/225/214/351/235/242-/350/276/223/345/205/245.md +42 -0
- package/dist/template-empty/.ai/reference/open-api/06-/347/275/221/347/273/234.md +148 -0
- package/dist/template-empty/.ai/reference/open-api/{07-media.md → 07-/345/252/222/344/275/223.md} +8 -8
- package/dist/template-empty/.ai/reference/open-api/{08-open- → 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 +83 -14
- package/dist/{template-starter/.ai/reference/open-api/09-device-bluetooth.md → template-empty/.ai/reference/open-api/09-/350/256/276/345/244/207-/350/223/235/347/211/231.md} +22 -46
- package/dist/{template-starter/.ai/reference/open-api/10-device-wi-fi.md → template-empty/.ai/reference/open-api/10-/350/256/276/345/244/207-wi-fi.md} +9 -9
- package/dist/template-empty/.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
- package/dist/template-empty/.ai/reference/open-api/12-/350/256/276/345/244/207-ibeacon.md +148 -0
- package/dist/template-empty/.ai/reference/open-api/13-/350/256/276/345/244/207-/347/275/227/347/233/230.md +82 -0
- package/dist/template-empty/.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
- package/dist/template-empty/.ai/reference/open-api/15-/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md +104 -0
- package/dist/template-empty/.ai/reference/open-api/16-ui-/350/276/223/345/205/245.md +65 -0
- package/dist/template-empty/.ai/reference/open-api/17-/350/256/276/345/244/207-/347/275/221/347/273/234.md +164 -0
- package/dist/template-empty/.ai/reference/open-api/18-/350/256/276/345/244/207-/347/237/255/344/277/241.md +62 -0
- package/dist/template-empty/.ai/reference/open-api/19-/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md +43 -0
- package/dist/template-empty/.ai/reference/open-api/20-/350/256/276/345/244/207-/347/224/265/346/261/240.md +83 -0
- package/dist/template-empty/.ai/reference/open-api/21-/350/256/276/345/244/207-/346/227/245/345/216/206.md +215 -0
- package/dist/template-empty/.ai/reference/open-api/22-/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md +70 -0
- package/dist/template-empty/.ai/reference/open-api/23-/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md +270 -0
- package/dist/template-empty/.ai/reference/open-api/24-/350/256/276/345/244/207-/345/212/240/345/257/206.md +56 -0
- package/dist/template-empty/.ai/reference/open-api/25-/350/256/276/345/244/207-/347/224/265/350/257/235.md +41 -0
- package/dist/template-empty/.ai/reference/open-api/26-/350/256/276/345/244/207-/346/211/253/347/240/201.md +100 -0
- package/dist/template-empty/.ai/reference/open-api/27-/350/256/276/345/244/207-/345/261/217/345/271/225.md +173 -0
- package/dist/template-empty/.ai/reference/open-api/28-/350/256/276/345/244/207-/351/234/207/345/212/250.md +66 -0
- package/dist/template-empty/.ai/reference/open-api/README.md +27 -11
- package/dist/template-empty/.ai/reference/open-api.md +275 -8
- package/dist/template-empty/.ai/rules/dos-and-donts.md +50 -37
- package/dist/template-empty/AGENTS.md +54 -31
- package/dist/template-empty/README.md +57 -10
- package/dist/template-empty/package.json +2 -2
- package/dist/template-empty/src/app.config.ts +6 -0
- package/dist/template-empty/src/app.ts +0 -6
- package/dist/template-empty/tsconfig.json +2 -0
- package/dist/template-starter/.ai/examples/common-patterns.md +53 -43
- package/dist/template-starter/.ai/examples/component-basics.md +0 -17
- package/dist/template-starter/.ai/guides/component-development.md +96 -214
- package/dist/template-starter/.ai/guides/system-prompt.md +14 -14
- package/dist/template-starter/.ai/reference/framework-api-quick-ref.md +46 -85
- package/dist/template-starter/.ai/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +13 -13
- package/dist/template-starter/.ai/reference/open-api/{02-storage.md → 02-/345/255/230/345/202/250.md} +13 -21
- package/dist/template-starter/.ai/reference/open-api/{03-router.md → 03-/350/267/257/347/224/261.md} +9 -9
- package/dist/{template-empty/.ai/reference/open-api/04-ui- → template-starter/.ai/reference/open-api/04-/347/225/214/351/235/242-}/344/272/244/344/272/222.md +12 -12
- package/dist/template-starter/.ai/reference/open-api/05-/347/225/214/351/235/242-/350/276/223/345/205/245.md +42 -0
- package/dist/template-starter/.ai/reference/open-api/06-/347/275/221/347/273/234.md +148 -0
- package/dist/template-starter/.ai/reference/open-api/{07-media.md → 07-/345/252/222/344/275/223.md} +8 -8
- package/dist/template-starter/.ai/reference/open-api/{08-open- → 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 +83 -14
- package/dist/{template-empty/.ai/reference/open-api/09-device-bluetooth.md → template-starter/.ai/reference/open-api/09-/350/256/276/345/244/207-/350/223/235/347/211/231.md} +22 -46
- package/dist/{template-empty/.ai/reference/open-api/10-device-wi-fi.md → template-starter/.ai/reference/open-api/10-/350/256/276/345/244/207-wi-fi.md} +9 -9
- package/dist/template-starter/.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
- package/dist/template-starter/.ai/reference/open-api/12-/350/256/276/345/244/207-ibeacon.md +148 -0
- package/dist/template-starter/.ai/reference/open-api/13-/350/256/276/345/244/207-/347/275/227/347/233/230.md +82 -0
- package/dist/template-starter/.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
- package/dist/template-starter/.ai/reference/open-api/15-/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md +104 -0
- package/dist/template-starter/.ai/reference/open-api/16-ui-/350/276/223/345/205/245.md +65 -0
- package/dist/template-starter/.ai/reference/open-api/17-/350/256/276/345/244/207-/347/275/221/347/273/234.md +164 -0
- package/dist/template-starter/.ai/reference/open-api/18-/350/256/276/345/244/207-/347/237/255/344/277/241.md +62 -0
- package/dist/template-starter/.ai/reference/open-api/19-/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md +43 -0
- package/dist/template-starter/.ai/reference/open-api/20-/350/256/276/345/244/207-/347/224/265/346/261/240.md +83 -0
- package/dist/template-starter/.ai/reference/open-api/21-/350/256/276/345/244/207-/346/227/245/345/216/206.md +215 -0
- package/dist/template-starter/.ai/reference/open-api/22-/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md +70 -0
- package/dist/template-starter/.ai/reference/open-api/23-/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md +270 -0
- package/dist/template-starter/.ai/reference/open-api/24-/350/256/276/345/244/207-/345/212/240/345/257/206.md +56 -0
- package/dist/template-starter/.ai/reference/open-api/25-/350/256/276/345/244/207-/347/224/265/350/257/235.md +41 -0
- package/dist/template-starter/.ai/reference/open-api/26-/350/256/276/345/244/207-/346/211/253/347/240/201.md +100 -0
- package/dist/template-starter/.ai/reference/open-api/27-/350/256/276/345/244/207-/345/261/217/345/271/225.md +173 -0
- package/dist/template-starter/.ai/reference/open-api/28-/350/256/276/345/244/207-/351/234/207/345/212/250.md +66 -0
- package/dist/template-starter/.ai/reference/open-api/README.md +27 -11
- package/dist/template-starter/.ai/reference/open-api.md +275 -8
- package/dist/template-starter/.ai/rules/dos-and-donts.md +50 -37
- package/dist/template-starter/AGENTS.md +54 -31
- package/dist/template-starter/README.md +6 -1
- package/dist/template-starter/package.json +2 -2
- package/dist/template-starter/src/app.config.ts +35 -0
- package/dist/template-starter/src/app.ts +0 -6
- package/dist/template-starter/src/pages/applet/index.tsx +0 -5
- package/dist/template-starter/src/pages/home/index.tsx +0 -5
- package/dist/template-starter/src/pages/lynx/index.tsx +0 -4
- package/dist/template-starter/src/pages/react-lynx/index.tsx +0 -5
- package/dist/template-starter/src/widgets/weather-card/index.tsx +0 -4
- package/dist/template-starter/tsconfig.json +2 -0
- package/package.json +1 -1
- package/dist/template-empty/.ai/reference/open-api/05-ui-/350/276/223/345/205/245.md +0 -95
- package/dist/template-empty/.ai/reference/open-api/06-network.md +0 -298
- package/dist/template-empty/.ai/reference/open-api/11-device-/344/274/240/346/204/237/345/231/250.md +0 -372
- package/dist/template-empty/.ai/reference/open-api/12-device-/346/234/254/345/234/260/350/203/275/345/212/233.md +0 -1005
- package/dist/template-starter/.ai/reference/open-api/05-ui-/350/276/223/345/205/245.md +0 -95
- package/dist/template-starter/.ai/reference/open-api/06-network.md +0 -298
- package/dist/template-starter/.ai/reference/open-api/11-device-/344/274/240/346/204/237/345/231/250.md +0 -372
- package/dist/template-starter/.ai/reference/open-api/12-device-/346/234/254/345/234/260/350/203/275/345/212/233.md +0 -1005
package/dist/template-starter/.ai/reference/open-api/{07-media.md → 07-/345/252/222/344/275/223.md}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Open API:
|
|
1
|
+
# Open API: 媒体
|
|
2
2
|
|
|
3
3
|
图片选择、预览、保存、压缩和信息读取。
|
|
4
4
|
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
## 速查
|
|
8
8
|
|
|
9
|
-
| API |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| [
|
|
12
|
-
| [
|
|
13
|
-
| [
|
|
14
|
-
| [
|
|
15
|
-
| [
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [saveImageToPhotosAlbum](#saveimagetophotosalbum) | 保存图片到系统相册。 |
|
|
12
|
+
| [previewImage](#previewimage) | 预览图片。 |
|
|
13
|
+
| [getImageInfo](#getimageinfo) | 获取图片信息。 |
|
|
14
|
+
| [chooseImage](#chooseimage) | 选择图片。 |
|
|
15
|
+
| [compressImage](#compressimage) | 压缩图片。 |
|
|
16
16
|
|
|
17
17
|
## API 详情
|
|
18
18
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Open API:
|
|
1
|
+
# Open API: 开放能力 / 业务能力
|
|
2
2
|
|
|
3
3
|
开放业务能力、支付、隐私设置、上下文和外部应用打开。
|
|
4
4
|
|
|
@@ -6,19 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|
## 速查
|
|
8
8
|
|
|
9
|
-
| API |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| [
|
|
12
|
-
| [
|
|
13
|
-
| [
|
|
14
|
-
| [
|
|
15
|
-
| [
|
|
16
|
-
| [
|
|
17
|
-
| [
|
|
18
|
-
| [
|
|
19
|
-
| [
|
|
20
|
-
| [
|
|
21
|
-
| [
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [getOrderPayment](#getorderpayment) | 查询订单支付结果。 |
|
|
12
|
+
| [postLoginResult](#postloginresult) | 回传 MCP 授权登录凭证。 |
|
|
13
|
+
| [getPrivacySetting](#getprivacysetting) | 获取隐私设置状态。 |
|
|
14
|
+
| [requestOrder](#requestorder) | 发起订单支付流程。 |
|
|
15
|
+
| [loginWithDoubaoWidget](#loginwithdoubaowidget) | 发起豆包 Widget 登录。 |
|
|
16
|
+
| [sendQueryMessage](#sendquerymessage) | 以用户身份发送一条消息。<br><br>返回 void,不是 Promise。 |
|
|
17
|
+
| [updateModelContext](#updatemodelcontext) | 向 Agent 捐赠上下文。 |
|
|
18
|
+
| [setAdditionalContext](#setadditionalcontext) | 设置全局上下文供大模型理解。<br><br>设置全局上下文。 |
|
|
19
|
+
| [dispatchActionDirective](#dispatchactiondirective) | 描述用户行为,约束模型行为及指定执行路径。 |
|
|
20
|
+
| [updateWidget](#updatewidget) | 更新指定卡片。 |
|
|
21
|
+
| [expiredWidget](#expiredwidget) | 更新过期的 widget 为固定卡片。 |
|
|
22
|
+
| [openApp](#openapp) | 通过 deep link 等方式打开外部应用。 |
|
|
22
23
|
|
|
23
24
|
## API 详情
|
|
24
25
|
|
|
@@ -202,6 +203,34 @@ await sendQueryMessage({ content: '订阅消息', type: 'text' })
|
|
|
202
203
|
|
|
203
204
|
`Promise`\<`object`\>
|
|
204
205
|
|
|
206
|
+
<a id="expiredwidget"></a>
|
|
207
|
+
### expiredWidget()
|
|
208
|
+
|
|
209
|
+
> **expiredWidget**(`__namedParameters`): `Promise`\<`object`\>
|
|
210
|
+
|
|
211
|
+
更新过期的 widget 为固定卡片
|
|
212
|
+
|
|
213
|
+
#### Parameters
|
|
214
|
+
|
|
215
|
+
• **\_\_namedParameters**: [`ExpiredWidgetParams`](#expiredwidgetparams)
|
|
216
|
+
|
|
217
|
+
#### Returns
|
|
218
|
+
|
|
219
|
+
`Promise`\<`object`\>
|
|
220
|
+
|
|
221
|
+
#### Description
|
|
222
|
+
|
|
223
|
+
用于将状态已经过期的 widget 实例转换为固定的卡片
|
|
224
|
+
|
|
225
|
+
#### Example
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
expiredWidget({
|
|
229
|
+
widgetInstanceId: 'instance_123',
|
|
230
|
+
schema: '${pageId}?key=value'
|
|
231
|
+
});
|
|
232
|
+
```
|
|
233
|
+
|
|
205
234
|
<a id="openapp"></a>
|
|
206
235
|
### openApp()
|
|
207
236
|
|
|
@@ -414,6 +443,29 @@ Widget 登录类型。
|
|
|
414
443
|
|
|
415
444
|
会话消息关联的卡片ID
|
|
416
445
|
|
|
446
|
+
<a id="actiondirectivetype"></a>
|
|
447
|
+
### ActionDirectiveType
|
|
448
|
+
|
|
449
|
+
#### Enumeration Members
|
|
450
|
+
|
|
451
|
+
##### BUTTON\_CLICK
|
|
452
|
+
|
|
453
|
+
> **BUTTON\_CLICK**: `"button_click"`
|
|
454
|
+
|
|
455
|
+
按钮点击
|
|
456
|
+
|
|
457
|
+
##### FORM\_SUBMIT
|
|
458
|
+
|
|
459
|
+
> **FORM\_SUBMIT**: `"form_submit"`
|
|
460
|
+
|
|
461
|
+
表单提交(复杂的信息提交场景)
|
|
462
|
+
|
|
463
|
+
##### OPTION\_SELECT
|
|
464
|
+
|
|
465
|
+
> **OPTION\_SELECT**: `"option_select"`
|
|
466
|
+
|
|
467
|
+
选择(下拉列表场景)
|
|
468
|
+
|
|
417
469
|
<a id="updatewidgetparams"></a>
|
|
418
470
|
### UpdateWidgetParams
|
|
419
471
|
|
|
@@ -437,6 +489,23 @@ Widget 登录类型。
|
|
|
437
489
|
|
|
438
490
|
需要更新的widget 实例 ID
|
|
439
491
|
|
|
492
|
+
<a id="expiredwidgetparams"></a>
|
|
493
|
+
### ExpiredWidgetParams
|
|
494
|
+
|
|
495
|
+
#### Properties
|
|
496
|
+
|
|
497
|
+
##### schema?
|
|
498
|
+
|
|
499
|
+
> `optional` **schema**: `string`
|
|
500
|
+
|
|
501
|
+
点击失效卡要跳转的页面 schema,格式与 navigateTo 的 url 相同
|
|
502
|
+
|
|
503
|
+
##### widgetInstanceId
|
|
504
|
+
|
|
505
|
+
> **widgetInstanceId**: `string`
|
|
506
|
+
|
|
507
|
+
卡片实例 ID,在卡片环境通过getWidgetInstanceId来获取,其他环境(比如页面)需要通过传参或通信的方式传递过去
|
|
508
|
+
|
|
440
509
|
<a id="openapprequest"></a>
|
|
441
510
|
### OpenAppRequest
|
|
442
511
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Open API:
|
|
1
|
+
# Open API: 设备 / 蓝牙
|
|
2
2
|
|
|
3
3
|
蓝牙和 BLE 能力;通常先打开适配器,再扫描、连接和读写。
|
|
4
4
|
|
|
@@ -6,27 +6,27 @@
|
|
|
6
6
|
|
|
7
7
|
## 速查
|
|
8
8
|
|
|
9
|
-
| API |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| [
|
|
12
|
-
| [
|
|
13
|
-
| [
|
|
14
|
-
| [
|
|
15
|
-
| [
|
|
16
|
-
| [
|
|
17
|
-
| [
|
|
18
|
-
| [
|
|
19
|
-
| [
|
|
20
|
-
| [
|
|
21
|
-
| [
|
|
22
|
-
| [
|
|
23
|
-
| [
|
|
24
|
-
| [
|
|
25
|
-
| [
|
|
26
|
-
| [
|
|
27
|
-
| [
|
|
28
|
-
| [
|
|
29
|
-
| [
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [openBluetoothAdapter](#openbluetoothadapter) | 打开蓝牙适配器。<br><br>蓝牙流程入口。 |
|
|
12
|
+
| [startBluetoothDevicesDiscovery](#startbluetoothdevicesdiscovery) | 开始搜索附近的蓝牙设备。<br><br>通常先调用 openBluetoothAdapter。 |
|
|
13
|
+
| [stopBluetoothDevicesDiscovery](#stopbluetoothdevicesdiscovery) | 停止搜索附近的蓝牙设备。 |
|
|
14
|
+
| [getBluetoothAdapterState](#getbluetoothadapterstate) | 获取蓝牙适配器状态。 |
|
|
15
|
+
| [getBluetoothDevices](#getbluetoothdevices) | 获取当前蓝牙模块发现的设备列表。<br><br>通常先调用 startBluetoothDevicesDiscovery。 |
|
|
16
|
+
| [getConnectedBluetoothDevices](#getconnectedbluetoothdevices) | 获取已连接的蓝牙设备列表。 |
|
|
17
|
+
| [makeBluetoothPair](#makebluetoothpair) | 发起蓝牙配对。 |
|
|
18
|
+
| [isBluetoothDevicePaired](#isbluetoothdevicepaired) | 查询蓝牙设备是否已经配对。 |
|
|
19
|
+
| [closeBluetoothAdapter](#closebluetoothadapter) | 关闭蓝牙适配器。<br><br>会关闭蓝牙模块。 |
|
|
20
|
+
| [createBLEConnection](#createbleconnection) | 创建 BLE 连接。<br><br>需要传入 deviceId。 |
|
|
21
|
+
| [closeBLEConnection](#closebleconnection) | 关闭 BLE 连接。 |
|
|
22
|
+
| [getBLEDeviceServices](#getbledeviceservices) | 获取 BLE 服务列表。<br><br>通常先调用 createBLEConnection。 |
|
|
23
|
+
| [getBLEDeviceCharacteristics](#getbledevicecharacteristics) | 获取 BLE 特征值列表。<br><br>通常先获取 BLE 服务列表。 |
|
|
24
|
+
| [getBLEDeviceRSSI](#getbledevicerssi) | 获取 BLE 设备 RSSI。 |
|
|
25
|
+
| [getBLEMTU](#getblemtu) | 获取 BLE MTU。 |
|
|
26
|
+
| [notifyBLECharacteristicValueChange](#notifyblecharacteristicvaluechange) | 订阅 BLE 特征值变化。<br><br>订阅指定特征值变化。 |
|
|
27
|
+
| [readBLECharacteristicValue](#readblecharacteristicvalue) | 读取 BLE 特征值。<br><br>需要传入 serviceId 和 characteristicId。 |
|
|
28
|
+
| [setBLEMTU](#setblemtu) | 设置 BLE MTU。 |
|
|
29
|
+
| [writeBLECharacteristicValue](#writeblecharacteristicvalue) | 写入 BLE 特征值。<br><br>value 需要是 ArrayBuffer。 |
|
|
30
30
|
|
|
31
31
|
## API 详情
|
|
32
32
|
|
|
@@ -355,30 +355,6 @@
|
|
|
355
355
|
|
|
356
356
|
value 需要是 ArrayBuffer。
|
|
357
357
|
|
|
358
|
-
## Enumerations
|
|
359
|
-
|
|
360
|
-
### ActionDirectiveType
|
|
361
|
-
|
|
362
|
-
#### Enumeration Members
|
|
363
|
-
|
|
364
|
-
##### BUTTON\_CLICK
|
|
365
|
-
|
|
366
|
-
> **BUTTON\_CLICK**: `"button_click"`
|
|
367
|
-
|
|
368
|
-
按钮点击
|
|
369
|
-
|
|
370
|
-
##### FORM\_SUBMIT
|
|
371
|
-
|
|
372
|
-
> **FORM\_SUBMIT**: `"form_submit"`
|
|
373
|
-
|
|
374
|
-
表单提交(复杂的信息提交场景)
|
|
375
|
-
|
|
376
|
-
##### OPTION\_SELECT
|
|
377
|
-
|
|
378
|
-
> **OPTION\_SELECT**: `"option_select"`
|
|
379
|
-
|
|
380
|
-
选择(下拉列表场景)
|
|
381
|
-
|
|
382
358
|
## 相关类型
|
|
383
359
|
|
|
384
360
|
<a id="openbluetoothadapterparams"></a>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Open API:
|
|
1
|
+
# Open API: 设备 / Wi-Fi
|
|
2
2
|
|
|
3
3
|
Wi-Fi 模块能力;通常先 startWifi,再获取列表或连接。
|
|
4
4
|
|
|
@@ -6,14 +6,14 @@ Wi-Fi 模块能力;通常先 startWifi,再获取列表或连接。
|
|
|
6
6
|
|
|
7
7
|
## 速查
|
|
8
8
|
|
|
9
|
-
| API |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| [
|
|
12
|
-
| [
|
|
13
|
-
| [
|
|
14
|
-
| [
|
|
15
|
-
| [
|
|
16
|
-
| [
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [startWifi](#startwifi) | 初始化 Wi-Fi 模块。<br><br>Wi-Fi 流程入口。 |
|
|
12
|
+
| [stopWifi](#stopwifi) | 关闭 Wi-Fi 模块。 |
|
|
13
|
+
| [setWifiList](#setwifilist) | 设置 Wi-Fi 预设列表。<br><br>用于预设 Wi-Fi 列表。 |
|
|
14
|
+
| [connectWifi](#connectwifi) | 连接指定 Wi-Fi。<br><br>通常先调用 startWifi。 |
|
|
15
|
+
| [getConnectedWifi](#getconnectedwifi) | 获取当前已连接 Wi-Fi 信息。 |
|
|
16
|
+
| [getWifiList](#getwifilist) | 获取 Wi-Fi 列表。<br><br>通常先调用 startWifi。 |
|
|
17
17
|
|
|
18
18
|
## API 详情
|
|
19
19
|
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Open API: 设备 / 加速度计
|
|
2
|
+
|
|
3
|
+
加速度计监听能力。
|
|
4
|
+
|
|
5
|
+
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [startAccelerometer](#startaccelerometer) | 开始监听加速度。<br><br>需配对调用 stopAccelerometer。 |
|
|
12
|
+
| [stopAccelerometer](#stopaccelerometer) | 停止监听加速度。 |
|
|
13
|
+
| [onAccelerometerChange](#onaccelerometerchange) | 监听加速度数据变化事件。<br><br>返回取消监听函数。 |
|
|
14
|
+
|
|
15
|
+
## API 详情
|
|
16
|
+
|
|
17
|
+
<a id="startaccelerometer"></a>
|
|
18
|
+
### startAccelerometer()
|
|
19
|
+
|
|
20
|
+
> **startAccelerometer**(`params`?): `Promise`\<`object`\>
|
|
21
|
+
|
|
22
|
+
开始监听加速度。
|
|
23
|
+
|
|
24
|
+
#### Parameters
|
|
25
|
+
|
|
26
|
+
• **params?**: [`StartAccelerometerParams`](#startaccelerometerparams)
|
|
27
|
+
|
|
28
|
+
#### Returns
|
|
29
|
+
|
|
30
|
+
`Promise`\<`object`\>
|
|
31
|
+
|
|
32
|
+
#### Remarks
|
|
33
|
+
|
|
34
|
+
需配对调用 stopAccelerometer。
|
|
35
|
+
|
|
36
|
+
<a id="stopaccelerometer"></a>
|
|
37
|
+
### stopAccelerometer()
|
|
38
|
+
|
|
39
|
+
> **stopAccelerometer**(`params`?): `Promise`\<`object`\>
|
|
40
|
+
|
|
41
|
+
停止监听加速度。
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
• **params?**
|
|
46
|
+
|
|
47
|
+
#### Returns
|
|
48
|
+
|
|
49
|
+
`Promise`\<`object`\>
|
|
50
|
+
|
|
51
|
+
<a id="onaccelerometerchange"></a>
|
|
52
|
+
### onAccelerometerChange()
|
|
53
|
+
|
|
54
|
+
> **onAccelerometerChange**(`handler`): () => `void`
|
|
55
|
+
|
|
56
|
+
监听加速度数据变化事件。
|
|
57
|
+
|
|
58
|
+
#### Parameters
|
|
59
|
+
|
|
60
|
+
• **handler**
|
|
61
|
+
|
|
62
|
+
#### Returns
|
|
63
|
+
|
|
64
|
+
`Function`
|
|
65
|
+
|
|
66
|
+
返回取消当前监听函数的函数。
|
|
67
|
+
|
|
68
|
+
##### Returns
|
|
69
|
+
|
|
70
|
+
`void`
|
|
71
|
+
|
|
72
|
+
#### Example
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { onAccelerometerChange } from '@doubao-apps/framework/api';
|
|
76
|
+
|
|
77
|
+
const off = onAccelerometerChange(({ x, y, z, timestamp }) => {
|
|
78
|
+
console.log(x, y, z, timestamp);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
off();
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 相关类型
|
|
85
|
+
|
|
86
|
+
<a id="startaccelerometerparams"></a>
|
|
87
|
+
### StartAccelerometerParams
|
|
88
|
+
|
|
89
|
+
开始监听加速度的请求参数。
|
|
90
|
+
|
|
91
|
+
#### Properties
|
|
92
|
+
|
|
93
|
+
##### interval?
|
|
94
|
+
|
|
95
|
+
> `optional` **interval**: [`SensorInterval`](#sensorinterval)
|
|
96
|
+
|
|
97
|
+
监听频率。
|
|
98
|
+
|
|
99
|
+
<a id="sensorinterval"></a>
|
|
100
|
+
### SensorInterval
|
|
101
|
+
|
|
102
|
+
> **SensorInterval**: `"game"` \| `"ui"` \| `"normal"`
|
|
103
|
+
|
|
104
|
+
传感器监听频率。
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Open API: 设备 / iBeacon
|
|
2
|
+
|
|
3
|
+
iBeacon 搜索和结果读取能力。
|
|
4
|
+
|
|
5
|
+
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [startBeaconDiscovery](#startbeacondiscovery) | 开始搜索附近的 iBeacon。<br><br>需配对调用 stopBeaconDiscovery。 |
|
|
12
|
+
| [stopBeaconDiscovery](#stopbeacondiscovery) | 停止搜索附近的 iBeacon。 |
|
|
13
|
+
| [getBeacons](#getbeacons) | 获取已搜索到的 iBeacon 列表。 |
|
|
14
|
+
|
|
15
|
+
## API 详情
|
|
16
|
+
|
|
17
|
+
<a id="startbeacondiscovery"></a>
|
|
18
|
+
### startBeaconDiscovery()
|
|
19
|
+
|
|
20
|
+
> **startBeaconDiscovery**(`params`): `Promise`\<`object`\>
|
|
21
|
+
|
|
22
|
+
开始搜索附近的 iBeacon。
|
|
23
|
+
|
|
24
|
+
#### Parameters
|
|
25
|
+
|
|
26
|
+
• **params**: [`StartBeaconDiscoveryParams`](#startbeacondiscoveryparams)
|
|
27
|
+
|
|
28
|
+
#### Returns
|
|
29
|
+
|
|
30
|
+
`Promise`\<`object`\>
|
|
31
|
+
|
|
32
|
+
#### Remarks
|
|
33
|
+
|
|
34
|
+
需配对调用 stopBeaconDiscovery。
|
|
35
|
+
|
|
36
|
+
<a id="stopbeacondiscovery"></a>
|
|
37
|
+
### stopBeaconDiscovery()
|
|
38
|
+
|
|
39
|
+
> **stopBeaconDiscovery**(`params`?): `Promise`\<`object`\>
|
|
40
|
+
|
|
41
|
+
停止搜索附近的 iBeacon。
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
• **params?**
|
|
46
|
+
|
|
47
|
+
#### Returns
|
|
48
|
+
|
|
49
|
+
`Promise`\<`object`\>
|
|
50
|
+
|
|
51
|
+
<a id="getbeacons"></a>
|
|
52
|
+
### getBeacons()
|
|
53
|
+
|
|
54
|
+
> **getBeacons**(`params`?): `Promise`\<[`GetBeaconsResult`](#getbeaconsresult)\>
|
|
55
|
+
|
|
56
|
+
获取已搜索到的 iBeacon 列表。
|
|
57
|
+
|
|
58
|
+
#### Parameters
|
|
59
|
+
|
|
60
|
+
• **params?**
|
|
61
|
+
|
|
62
|
+
#### Returns
|
|
63
|
+
|
|
64
|
+
`Promise`\<[`GetBeaconsResult`](#getbeaconsresult)\>
|
|
65
|
+
|
|
66
|
+
## 相关类型
|
|
67
|
+
|
|
68
|
+
<a id="startbeacondiscoveryparams"></a>
|
|
69
|
+
### StartBeaconDiscoveryParams
|
|
70
|
+
|
|
71
|
+
开始搜索 iBeacon 的请求参数。
|
|
72
|
+
|
|
73
|
+
#### Properties
|
|
74
|
+
|
|
75
|
+
##### ignoreBluetoothAvailable?
|
|
76
|
+
|
|
77
|
+
> `optional` **ignoreBluetoothAvailable**: `boolean`
|
|
78
|
+
|
|
79
|
+
iOS 下是否忽略蓝牙可用性校验。
|
|
80
|
+
|
|
81
|
+
##### uuids
|
|
82
|
+
|
|
83
|
+
> **uuids**: `string`[]
|
|
84
|
+
|
|
85
|
+
要搜索的 iBeacon UUID 列表。
|
|
86
|
+
|
|
87
|
+
<a id="getbeaconsresult"></a>
|
|
88
|
+
### GetBeaconsResult
|
|
89
|
+
|
|
90
|
+
获取 iBeacon 列表的返回结果。
|
|
91
|
+
|
|
92
|
+
#### Properties
|
|
93
|
+
|
|
94
|
+
##### beacons
|
|
95
|
+
|
|
96
|
+
> **beacons**: [`BeaconInfo`](#beaconinfo)[]
|
|
97
|
+
|
|
98
|
+
当前搜到的 iBeacon 列表。
|
|
99
|
+
|
|
100
|
+
<a id="beaconinfo"></a>
|
|
101
|
+
### BeaconInfo
|
|
102
|
+
|
|
103
|
+
iBeacon 设备信息。
|
|
104
|
+
|
|
105
|
+
#### Properties
|
|
106
|
+
|
|
107
|
+
##### accuracy
|
|
108
|
+
|
|
109
|
+
> **accuracy**: `number`
|
|
110
|
+
|
|
111
|
+
距离,单位米。
|
|
112
|
+
|
|
113
|
+
##### major
|
|
114
|
+
|
|
115
|
+
> **major**: `string`
|
|
116
|
+
|
|
117
|
+
主 ID。
|
|
118
|
+
|
|
119
|
+
##### minor
|
|
120
|
+
|
|
121
|
+
> **minor**: `string`
|
|
122
|
+
|
|
123
|
+
次 ID。
|
|
124
|
+
|
|
125
|
+
##### proximity
|
|
126
|
+
|
|
127
|
+
> **proximity**: [`BeaconProximity`](#beaconproximity)
|
|
128
|
+
|
|
129
|
+
距离等级。
|
|
130
|
+
|
|
131
|
+
##### rssi
|
|
132
|
+
|
|
133
|
+
> **rssi**: `number`
|
|
134
|
+
|
|
135
|
+
RSSI 信号强度,单位 dBm。
|
|
136
|
+
|
|
137
|
+
##### uuid
|
|
138
|
+
|
|
139
|
+
> **uuid**: `string`
|
|
140
|
+
|
|
141
|
+
Beacon UUID。
|
|
142
|
+
|
|
143
|
+
<a id="beaconproximity"></a>
|
|
144
|
+
### BeaconProximity
|
|
145
|
+
|
|
146
|
+
> **BeaconProximity**: `0` \| `1` \| `2` \| `3`
|
|
147
|
+
|
|
148
|
+
iBeacon 距离等级。
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Open API: 设备 / 罗盘
|
|
2
|
+
|
|
3
|
+
罗盘监听能力。
|
|
4
|
+
|
|
5
|
+
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [startCompass](#startcompass) | 开始监听罗盘。<br><br>需配对调用 stopCompass。 |
|
|
12
|
+
| [stopCompass](#stopcompass) | 停止监听罗盘。 |
|
|
13
|
+
| [onCompassChange](#oncompasschange) | 监听罗盘数据变化事件。<br><br>返回取消监听函数。 |
|
|
14
|
+
|
|
15
|
+
## API 详情
|
|
16
|
+
|
|
17
|
+
<a id="startcompass"></a>
|
|
18
|
+
### startCompass()
|
|
19
|
+
|
|
20
|
+
> **startCompass**(`params`?): `Promise`\<`object`\>
|
|
21
|
+
|
|
22
|
+
开始监听罗盘。
|
|
23
|
+
|
|
24
|
+
#### Parameters
|
|
25
|
+
|
|
26
|
+
• **params?**
|
|
27
|
+
|
|
28
|
+
#### Returns
|
|
29
|
+
|
|
30
|
+
`Promise`\<`object`\>
|
|
31
|
+
|
|
32
|
+
#### Remarks
|
|
33
|
+
|
|
34
|
+
需配对调用 stopCompass。
|
|
35
|
+
|
|
36
|
+
<a id="stopcompass"></a>
|
|
37
|
+
### stopCompass()
|
|
38
|
+
|
|
39
|
+
> **stopCompass**(`params`?): `Promise`\<`object`\>
|
|
40
|
+
|
|
41
|
+
停止监听罗盘。
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
• **params?**
|
|
46
|
+
|
|
47
|
+
#### Returns
|
|
48
|
+
|
|
49
|
+
`Promise`\<`object`\>
|
|
50
|
+
|
|
51
|
+
<a id="oncompasschange"></a>
|
|
52
|
+
### onCompassChange()
|
|
53
|
+
|
|
54
|
+
> **onCompassChange**(`handler`): () => `void`
|
|
55
|
+
|
|
56
|
+
监听罗盘数据变化事件。
|
|
57
|
+
|
|
58
|
+
#### Parameters
|
|
59
|
+
|
|
60
|
+
• **handler**
|
|
61
|
+
|
|
62
|
+
#### Returns
|
|
63
|
+
|
|
64
|
+
`Function`
|
|
65
|
+
|
|
66
|
+
返回取消当前监听函数的函数。
|
|
67
|
+
|
|
68
|
+
##### Returns
|
|
69
|
+
|
|
70
|
+
`void`
|
|
71
|
+
|
|
72
|
+
#### Example
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { onCompassChange } from '@doubao-apps/framework/api';
|
|
76
|
+
|
|
77
|
+
const off = onCompassChange(({ direction }) => {
|
|
78
|
+
console.log(direction);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
off();
|
|
82
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Open API: 设备 / 设备方向
|
|
2
|
+
|
|
3
|
+
设备方向监听能力。
|
|
4
|
+
|
|
5
|
+
[返回目录](./README.md) | [返回速查](../open-api.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [startDeviceMotionListening](#startdevicemotionlistening) | 开始监听设备方向变化。<br><br>需配对调用 stopDeviceMotionListening。 |
|
|
12
|
+
| [stopDeviceMotionListening](#stopdevicemotionlistening) | 停止监听设备方向变化。 |
|
|
13
|
+
|
|
14
|
+
## API 详情
|
|
15
|
+
|
|
16
|
+
<a id="startdevicemotionlistening"></a>
|
|
17
|
+
### startDeviceMotionListening()
|
|
18
|
+
|
|
19
|
+
> **startDeviceMotionListening**(`params`?): `Promise`\<`object`\>
|
|
20
|
+
|
|
21
|
+
开始监听设备方向变化。
|
|
22
|
+
|
|
23
|
+
#### Parameters
|
|
24
|
+
|
|
25
|
+
• **params?**: [`StartDeviceMotionListeningParams`](#startdevicemotionlisteningparams)
|
|
26
|
+
|
|
27
|
+
#### Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`object`\>
|
|
30
|
+
|
|
31
|
+
#### Remarks
|
|
32
|
+
|
|
33
|
+
需配对调用 stopDeviceMotionListening。
|
|
34
|
+
|
|
35
|
+
<a id="stopdevicemotionlistening"></a>
|
|
36
|
+
### stopDeviceMotionListening()
|
|
37
|
+
|
|
38
|
+
> **stopDeviceMotionListening**(`params`?): `Promise`\<`object`\>
|
|
39
|
+
|
|
40
|
+
停止监听设备方向变化。
|
|
41
|
+
|
|
42
|
+
#### Parameters
|
|
43
|
+
|
|
44
|
+
• **params?**
|
|
45
|
+
|
|
46
|
+
#### Returns
|
|
47
|
+
|
|
48
|
+
`Promise`\<`object`\>
|
|
49
|
+
|
|
50
|
+
## 相关类型
|
|
51
|
+
|
|
52
|
+
<a id="startdevicemotionlisteningparams"></a>
|
|
53
|
+
### StartDeviceMotionListeningParams
|
|
54
|
+
|
|
55
|
+
开始监听设备方向变化的请求参数。
|
|
56
|
+
|
|
57
|
+
#### Properties
|
|
58
|
+
|
|
59
|
+
##### interval?
|
|
60
|
+
|
|
61
|
+
> `optional` **interval**: [`SensorInterval`](#sensorinterval)
|
|
62
|
+
|
|
63
|
+
监听频率。
|
|
64
|
+
|
|
65
|
+
<a id="sensorinterval"></a>
|
|
66
|
+
### SensorInterval
|
|
67
|
+
|
|
68
|
+
> **SensorInterval**: `"game"` \| `"ui"` \| `"normal"`
|
|
69
|
+
|
|
70
|
+
传感器监听频率。
|