@doubao-dev/plugin-app-dev 0.0.0-stage → 0.0.40-canary-dea0ddc73-20261026073950
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/README.md +10 -2
- package/dist/147.js +9 -0
- package/dist/assets.d.ts +5 -0
- package/dist/assets.js +4 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +1378 -0
- package/dist/plugin.d.ts +102 -0
- package/dist/plugin.js +4995 -0
- package/dist/preview.js +16 -0
- package/dist/rslib-runtime.js +33 -0
- package/dist/skills/doubao-plugin-app/SKILL.md +21 -0
- package/dist/skills/doubao-plugin-app/references/app-development.md +85 -0
- package/dist/skills/doubao-plugin-app/references/frontend/components/container-overlay.md +131 -0
- package/dist/skills/doubao-plugin-app/references/frontend/components/form-controls.md +146 -0
- package/dist/skills/doubao-plugin-app/references/frontend/components/interactive-controls.md +120 -0
- package/dist/skills/doubao-plugin-app/references/frontend/components/map-canvas.md +107 -0
- package/dist/skills/doubao-plugin-app/references/frontend/components/overview.md +43 -0
- package/dist/skills/doubao-plugin-app/references/frontend/components/scroll-list.md +149 -0
- package/dist/skills/doubao-plugin-app/references/frontend/components/text-media.md +209 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/01-/345/237/272/347/241/200.md +1389 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/02-/347/263/273/347/273/237.md +1376 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/03-/350/207/252/345/256/232/344/271/211/351/200/232/344/277/241.md +127 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/04-/345/256/232/344/275/215.md +784 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/05-/345/255/230/345/202/250.md +1176 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/06-/350/267/257/347/224/261.md +839 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/07-/347/225/214/351/235/242.md +376 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/08-/344/272/244/344/272/222.md +1319 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/09-/350/276/223/345/205/245.md +192 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/10-/347/275/221/347/273/234.md +900 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/11-/345/252/222/344/275/223.md +1496 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/12-/344/270/232/345/212/241/350/203/275/345/212/233.md +1281 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/13-/347/231/273/345/275/225.md +511 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/14-/346/224/257/344/273/230.md +943 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/15-/346/225/260/346/215/256/345/210/206/346/236/220.md +124 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/16-/350/223/235/347/211/231.md +3364 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/17-wi-fi.md +1028 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/18-/345/212/240/351/200/237/345/272/246/350/256/241.md +354 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/19-ibeacon.md +508 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/20-/347/275/227/347/233/230.md +320 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/21-/350/256/276/345/244/207/346/226/271/345/220/221.md +351 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/22-/351/231/200/350/236/272/344/273/252.md +354 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/23-/345/252/222/344/275/223-/350/256/276/345/244/207-/347/275/221/347/273/234.md +264 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/24-/347/237/255/344/277/241.md +155 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/25-/346/227/240/351/232/234/347/242/215.md +144 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/26-/345/237/272/347/241/200/344/277/241/346/201/257.md +238 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/27-/347/224/265/346/261/240.md +235 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/28-/345/211/252/350/264/264/346/235/277.md +303 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/29-/345/212/240/345/257/206.md +126 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/30-/346/227/245/345/216/206.md +417 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/31-/347/224/265/350/257/235.md +144 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/32-/346/211/253/347/240/201.md +236 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/33-/345/261/217/345/271/225.md +747 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/34-/351/234/207/345/212/250.md +277 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/35-/346/226/207/344/273/266/347/263/273/347/273/237.md +431 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/common-errors.md +69 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/groups.md +43 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/quick-reference.md +436 -0
- package/dist/skills/doubao-plugin-app/references/frontend/examples/common-patterns.md +590 -0
- package/dist/skills/doubao-plugin-app/references/frontend/examples/doubao-agentic-service-api-recipes.md +209 -0
- package/dist/skills/doubao-plugin-app/references/frontend/examples/page-widget-basics.md +368 -0
- package/dist/skills/doubao-plugin-app/references/frontend/examples/page-widget-recipes.md +65 -0
- package/dist/skills/doubao-plugin-app/references/frontend/framework/core.md +283 -0
- package/dist/skills/doubao-plugin-app/references/frontend/guides/auth.md +277 -0
- package/dist/skills/doubao-plugin-app/references/frontend/guides/best-practices.md +574 -0
- package/dist/skills/doubao-plugin-app/references/frontend/guides/client-tools-and-events.md +209 -0
- package/dist/skills/doubao-plugin-app/references/frontend/guides/component-development.md +832 -0
- package/dist/skills/doubao-plugin-app/references/frontend/guides/debugger-mcp.md +537 -0
- package/dist/skills/doubao-plugin-app/references/frontend/guides/expired-widget.md +101 -0
- package/dist/skills/doubao-plugin-app/references/frontend/guides/performance-optimization.md +417 -0
- package/dist/skills/doubao-plugin-app/references/frontend/guides/troubleshooting.md +278 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/best-practices.md +720 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/css/pseudo-classes.md +149 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/css/selectors.md +224 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/css/supported-properties.md +269 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/css/values-and-units.md +314 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/layout/flex-layout.md +334 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/layout/grid-layout.md +408 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/layout/linear-layout.md +355 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/layout/relative-layout.md +189 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/lynx-vs-web/css-differences.md +737 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/lynx-vs-web/migration-guide.md +669 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/lynx-vs-web/unsupported-features.md +290 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/overview.md +60 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/patterns/animation.md +243 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/patterns/responsive.md +194 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/patterns/theming.md +143 -0
- package/dist/skills/doubao-plugin-app/references/frontend/lynx/quick-reference.md +229 -0
- package/dist/skills/doubao-plugin-app/references/frontend/rules/dos-and-donts.md +479 -0
- package/dist/skills/doubao-plugin-app/references/frontend/widget-templates/design-boundary.md +46 -0
- package/dist/skills/doubao-plugin-app/references/frontend/widget-templates/overview.md +118 -0
- package/dist/skills/doubao-plugin-app/references/frontend/widget-templates/props.md +301 -0
- package/dist/skills/doubao-plugin-app/references/mcp-and-cards.md +38 -0
- package/dist/templates/README.md.template +11 -0
- package/dist/templates/com.doubao/app/manifest.yaml +41 -0
- package/dist/templates/com.doubao/app/package.json.template +13 -0
- package/dist/templates/com.doubao/app/src/app.config.ts.template +5 -0
- package/dist/templates/com.doubao/app/src/app.ts.template +3 -0
- package/dist/templates/com.doubao/app/src/pages/home/index.css +14 -0
- package/dist/templates/com.doubao/app/src/pages/home/index.tsx.template +14 -0
- package/dist/templates/com.doubao/app/src/widgets/example/index.tsx.template +29 -0
- package/dist/templates/com.doubao/app/tsconfig.json +19 -0
- package/dist/templates/mcp.json +9 -0
- package/dist/templates/plugin.json.template +29 -0
- package/dist/templates/skills/example/SKILL.md.template +14 -0
- package/dist/upload.d.ts +44 -0
- package/dist/upload.js +38 -0
- package/package.json +60 -3
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# 豆包应用插件的端能力 API: 短信
|
|
2
|
+
|
|
3
|
+
拉起系统短信发送面板。
|
|
4
|
+
|
|
5
|
+
[返回目录](./groups.md) | [返回速查](./quick-reference.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [sendSms](#sendsms) | 拉起系统短信发送面板。 |
|
|
12
|
+
|
|
13
|
+
## API 详情
|
|
14
|
+
|
|
15
|
+
<a id="sendsms"></a>
|
|
16
|
+
### sendSms()
|
|
17
|
+
|
|
18
|
+
# sendSms
|
|
19
|
+
|
|
20
|
+
拉起系统短信发送面板。
|
|
21
|
+
|
|
22
|
+
## 扫码预览
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
## 使用限制
|
|
26
|
+
|
|
27
|
+
> [!WARNING]
|
|
28
|
+
> **Android、iOS**:Android 通过 Intent 打开短信应用即成功,iOS 通过 MFMessageComposeViewController 呈现并在用户完成/取消后回调,成功时机不同;相同调用在双端"成功"代表的实际状态不同。
|
|
29
|
+
|
|
30
|
+
## 支持版本
|
|
31
|
+
|
|
32
|
+
前端库版本不低于 `0.0.25`。
|
|
33
|
+
|
|
34
|
+
## 支持平台
|
|
35
|
+
|
|
36
|
+
<table>
|
|
37
|
+
<thead>
|
|
38
|
+
<tr><th>平台</th><th>支持情况</th></tr>
|
|
39
|
+
</thead>
|
|
40
|
+
<tbody>
|
|
41
|
+
<tr><td>Android</td><td>支持</td></tr>
|
|
42
|
+
<tr><td>iOS</td><td>支持</td></tr>
|
|
43
|
+
<tr><td>PC</td><td>不支持</td></tr>
|
|
44
|
+
<tr><td>HarmonyOS</td><td>不支持</td></tr>
|
|
45
|
+
</tbody>
|
|
46
|
+
</table>
|
|
47
|
+
|
|
48
|
+
## 支持场景
|
|
49
|
+
|
|
50
|
+
<table>
|
|
51
|
+
<thead>
|
|
52
|
+
<tr><th>场景</th><th>支持情况</th></tr>
|
|
53
|
+
</thead>
|
|
54
|
+
<tbody>
|
|
55
|
+
<tr><td>页面</td><td>支持</td></tr>
|
|
56
|
+
<tr><td>卡片</td><td>支持</td></tr>
|
|
57
|
+
</tbody>
|
|
58
|
+
</table>
|
|
59
|
+
|
|
60
|
+
## 使用说明
|
|
61
|
+
|
|
62
|
+
- 该接口仅拉起系统短信面板,是否实际发送由用户在系统界面确认
|
|
63
|
+
|
|
64
|
+
## 调用方式
|
|
65
|
+
|
|
66
|
+
### 异步 API
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
sendSms(params?: SendSmsParams): Promise<object>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 入参
|
|
73
|
+
|
|
74
|
+
<table>
|
|
75
|
+
<thead>
|
|
76
|
+
<tr><th>名称</th><th>类型</th><th>必填</th><th>默认值</th><th>约束</th><th>说明</th></tr>
|
|
77
|
+
</thead>
|
|
78
|
+
<tbody>
|
|
79
|
+
<tr><td><code>message</code></td><td><code>string</code></td><td>否</td><td><code>-</code></td><td>-</td><td>预填到发送短信面板的内容。</td></tr>
|
|
80
|
+
<tr><td><code>phoneNumber</code></td><td><code>string</code></td><td>否</td><td><code>-</code></td><td>-</td><td>预填到发送短信面板的手机号。</td></tr>
|
|
81
|
+
</tbody>
|
|
82
|
+
</table>
|
|
83
|
+
|
|
84
|
+
## 调用示例
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import { sendSms } from '@doubao-dev/framework/api';
|
|
88
|
+
|
|
89
|
+
await sendSms({
|
|
90
|
+
phoneNumber: '10086',
|
|
91
|
+
message: '查询话费'
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## 成功返回
|
|
96
|
+
|
|
97
|
+
无返回字段。
|
|
98
|
+
|
|
99
|
+
### 返回示例
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## 错误处理
|
|
106
|
+
|
|
107
|
+
错误对象和通用错误码见 [通用错误处理](./common-errors.md#错误返回)。
|
|
108
|
+
|
|
109
|
+
### 失败示例
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"errNo": 114,
|
|
114
|
+
"errMsg": "operation cancelled"
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 错误码
|
|
119
|
+
|
|
120
|
+
<table>
|
|
121
|
+
<thead>
|
|
122
|
+
<tr><th>errNo</th><th>errMsg</th><th>平台</th><th>触发条件</th><th>处理建议</th></tr>
|
|
123
|
+
</thead>
|
|
124
|
+
<tbody>
|
|
125
|
+
<tr><td><code>103</code></td><td><code>feature not support</code></td><td>iOS</td><td>当前设备不支持发送短信</td><td>在支持短信的设备上调用,或提前提示用户设备不支持短信。</td></tr>
|
|
126
|
+
<tr><td><code>114</code></td><td><code>operation cancelled</code></td><td>iOS</td><td>用户在系统短信面板中取消了发送</td><td>用户需要时可再次调用 `sendSms` 重新拉起短信面板。</td></tr>
|
|
127
|
+
</tbody>
|
|
128
|
+
</table>
|
|
129
|
+
|
|
130
|
+
#### 通用错误码
|
|
131
|
+
|
|
132
|
+
<table>
|
|
133
|
+
<thead>
|
|
134
|
+
<tr><th>errNo</th><th>errMsg</th><th>说明</th><th>平台</th></tr>
|
|
135
|
+
</thead>
|
|
136
|
+
<tbody>
|
|
137
|
+
<tr><td><code>102</code></td><td><code>internal error</code></td><td>内部错误</td><td>Android、iOS</td></tr>
|
|
138
|
+
</tbody>
|
|
139
|
+
</table>
|
|
140
|
+
|
|
141
|
+
## 平台差异
|
|
142
|
+
|
|
143
|
+
- **iOS**:拉起短信面板后用户取消返回 114、发送失败返回 102、设备不支持短信返回 103;Android 无法拉起短信应用时返回 102。
|
|
144
|
+
|
|
145
|
+
## 相关类型
|
|
146
|
+
|
|
147
|
+
<a id="sendsmsparams"></a>
|
|
148
|
+
### SendSmsParams
|
|
149
|
+
|
|
150
|
+
拉起系统短信发送面板的请求参数。
|
|
151
|
+
|
|
152
|
+
#### Properties
|
|
153
|
+
|
|
154
|
+
• **phoneNumber?**: `string` - 预填到发送短信面板的手机号
|
|
155
|
+
• **message?**: `string` - 预填到发送短信面板的内容
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# 豆包应用插件的端能力 API: 无障碍
|
|
2
|
+
|
|
3
|
+
检测无障碍能力开关状态。
|
|
4
|
+
|
|
5
|
+
[返回目录](./groups.md) | [返回速查](./quick-reference.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [checkIsOpenAccessibility](#checkisopenaccessibility) | 检测无障碍能力是否开启。 |
|
|
12
|
+
|
|
13
|
+
## API 详情
|
|
14
|
+
|
|
15
|
+
<a id="checkisopenaccessibility"></a>
|
|
16
|
+
### checkIsOpenAccessibility()
|
|
17
|
+
|
|
18
|
+
# checkIsOpenAccessibility
|
|
19
|
+
|
|
20
|
+
检测无障碍能力是否开启。
|
|
21
|
+
|
|
22
|
+
## 扫码预览
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
## 支持版本
|
|
26
|
+
|
|
27
|
+
前端库版本不低于 `0.0.25`。
|
|
28
|
+
|
|
29
|
+
## 支持平台
|
|
30
|
+
|
|
31
|
+
<table>
|
|
32
|
+
<thead>
|
|
33
|
+
<tr><th>平台</th><th>支持情况</th></tr>
|
|
34
|
+
</thead>
|
|
35
|
+
<tbody>
|
|
36
|
+
<tr><td>Android</td><td>支持</td></tr>
|
|
37
|
+
<tr><td>iOS</td><td>支持</td></tr>
|
|
38
|
+
<tr><td>PC</td><td>不支持</td></tr>
|
|
39
|
+
<tr><td>HarmonyOS</td><td>不支持</td></tr>
|
|
40
|
+
</tbody>
|
|
41
|
+
</table>
|
|
42
|
+
|
|
43
|
+
## 支持场景
|
|
44
|
+
|
|
45
|
+
<table>
|
|
46
|
+
<thead>
|
|
47
|
+
<tr><th>场景</th><th>支持情况</th></tr>
|
|
48
|
+
</thead>
|
|
49
|
+
<tbody>
|
|
50
|
+
<tr><td>页面</td><td>支持</td></tr>
|
|
51
|
+
</tbody>
|
|
52
|
+
</table>
|
|
53
|
+
|
|
54
|
+
## 调用方式
|
|
55
|
+
|
|
56
|
+
### 异步 API
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
checkIsOpenAccessibility(params?: object): Promise<CheckIsOpenAccessibilityResult>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 入参
|
|
63
|
+
|
|
64
|
+
无。
|
|
65
|
+
|
|
66
|
+
## 调用示例
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import { checkIsOpenAccessibility } from '@doubao-dev/framework/api';
|
|
70
|
+
|
|
71
|
+
const { open } = await checkIsOpenAccessibility();
|
|
72
|
+
|
|
73
|
+
console.log(open);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## 成功返回
|
|
77
|
+
|
|
78
|
+
<table>
|
|
79
|
+
<thead>
|
|
80
|
+
<tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
|
|
81
|
+
</thead>
|
|
82
|
+
<tbody>
|
|
83
|
+
<tr><td><code>open</code></td><td><code>boolean</code></td><td>是</td><td>是否开启视觉无障碍能力。</td></tr>
|
|
84
|
+
</tbody>
|
|
85
|
+
</table>
|
|
86
|
+
|
|
87
|
+
### 返回示例
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"open": false
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## 错误处理
|
|
96
|
+
|
|
97
|
+
错误对象和通用错误码见 [通用错误处理](./common-errors.md#错误返回)。
|
|
98
|
+
|
|
99
|
+
### 失败示例
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"errNo": 103,
|
|
104
|
+
"errMsg": "feature not support"
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 错误码
|
|
109
|
+
|
|
110
|
+
<table>
|
|
111
|
+
<thead>
|
|
112
|
+
<tr><th>errNo</th><th>errMsg</th><th>平台</th><th>触发条件</th><th>处理建议</th></tr>
|
|
113
|
+
</thead>
|
|
114
|
+
<tbody>
|
|
115
|
+
<tr><td><code>103</code></td><td><code>feature not support</code></td><td>Android</td><td>当前设备不支持获取系统无障碍服务状态</td><td>在支持系统无障碍服务的设备上调用。</td></tr>
|
|
116
|
+
</tbody>
|
|
117
|
+
</table>
|
|
118
|
+
|
|
119
|
+
#### 通用错误码
|
|
120
|
+
|
|
121
|
+
<table>
|
|
122
|
+
<thead>
|
|
123
|
+
<tr><th>errNo</th><th>errMsg</th><th>说明</th><th>平台</th></tr>
|
|
124
|
+
</thead>
|
|
125
|
+
<tbody>
|
|
126
|
+
<tr><td><code>102</code></td><td><code>internal error</code></td><td>内部错误</td><td>Android</td></tr>
|
|
127
|
+
</tbody>
|
|
128
|
+
</table>
|
|
129
|
+
|
|
130
|
+
## 平台差异
|
|
131
|
+
|
|
132
|
+
- **Android**:检测系统无障碍服务是否开启
|
|
133
|
+
- **iOS**:检测 VoiceOver 或开关控制是否开启
|
|
134
|
+
|
|
135
|
+
## 相关类型
|
|
136
|
+
|
|
137
|
+
<a id="checkisopenaccessibilityresult"></a>
|
|
138
|
+
### CheckIsOpenAccessibilityResult
|
|
139
|
+
|
|
140
|
+
无障碍能力检测结果。
|
|
141
|
+
|
|
142
|
+
#### Properties
|
|
143
|
+
|
|
144
|
+
• **open**: `boolean` - 是否开启视觉无障碍能力
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# 豆包应用插件的端能力 API: 基础信息
|
|
2
|
+
|
|
3
|
+
设备品牌、型号、系统、内存和性能等级。
|
|
4
|
+
|
|
5
|
+
[返回目录](./groups.md) | [返回速查](./quick-reference.md)
|
|
6
|
+
|
|
7
|
+
## 速查
|
|
8
|
+
|
|
9
|
+
| API | 说明 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| [getDeviceInfo](#getdeviceinfo) | 获取设备基础信息。 |
|
|
12
|
+
| [getDeviceInfoSync](#getdeviceinfosync) | 同步获取设备基础信息。<br><br>同步 API。 |
|
|
13
|
+
|
|
14
|
+
## API 详情
|
|
15
|
+
|
|
16
|
+
<a id="getdeviceinfo"></a>
|
|
17
|
+
### getDeviceInfo()
|
|
18
|
+
|
|
19
|
+
# getDeviceInfo
|
|
20
|
+
|
|
21
|
+
获取设备基础信息。
|
|
22
|
+
|
|
23
|
+
## 扫码预览
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
## 支持版本
|
|
27
|
+
|
|
28
|
+
前端库版本不低于 `0.0.32`。
|
|
29
|
+
|
|
30
|
+
## 支持平台
|
|
31
|
+
|
|
32
|
+
<table>
|
|
33
|
+
<thead>
|
|
34
|
+
<tr><th>平台</th><th>支持情况</th></tr>
|
|
35
|
+
</thead>
|
|
36
|
+
<tbody>
|
|
37
|
+
<tr><td>Android</td><td>支持</td></tr>
|
|
38
|
+
<tr><td>iOS</td><td>支持</td></tr>
|
|
39
|
+
<tr><td>PC</td><td>支持</td></tr>
|
|
40
|
+
<tr><td>HarmonyOS</td><td>不支持</td></tr>
|
|
41
|
+
</tbody>
|
|
42
|
+
</table>
|
|
43
|
+
|
|
44
|
+
## 支持场景
|
|
45
|
+
|
|
46
|
+
<table>
|
|
47
|
+
<thead>
|
|
48
|
+
<tr><th>场景</th><th>支持情况</th></tr>
|
|
49
|
+
</thead>
|
|
50
|
+
<tbody>
|
|
51
|
+
<tr><td>页面</td><td>支持</td></tr>
|
|
52
|
+
<tr><td>卡片</td><td>支持</td></tr>
|
|
53
|
+
</tbody>
|
|
54
|
+
</table>
|
|
55
|
+
|
|
56
|
+
## 调用方式
|
|
57
|
+
|
|
58
|
+
### 异步 API
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
getDeviceInfo(params?: object): Promise<GetDeviceInfoResult>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 入参
|
|
65
|
+
|
|
66
|
+
无。
|
|
67
|
+
|
|
68
|
+
## 调用示例
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import { getDeviceInfo } from '@doubao-dev/framework/api';
|
|
72
|
+
|
|
73
|
+
const result = await getDeviceInfo();
|
|
74
|
+
|
|
75
|
+
console.log(result.brand, result.model, result.system);
|
|
76
|
+
console.log(result.platform, result.benchmarkLevel);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 成功返回
|
|
80
|
+
|
|
81
|
+
<table>
|
|
82
|
+
<thead>
|
|
83
|
+
<tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
|
|
84
|
+
</thead>
|
|
85
|
+
<tbody>
|
|
86
|
+
<tr><td><code>abi</code></td><td><code>string</code></td><td>否</td><td>豆包客户端二进制接口类型,仅 Android 支持。</td></tr>
|
|
87
|
+
<tr><td><code>benchmarkLevel</code></td><td><code>number</code></td><td>是</td><td>设备性能等级,值越高性能越好;-1 表示未知。</td></tr>
|
|
88
|
+
<tr><td><code>brand</code></td><td><code>string</code></td><td>是</td><td>设备品牌。</td></tr>
|
|
89
|
+
<tr><td><code>cpuType</code></td><td><code>string</code></td><td>否</td><td>设备 CPU 型号,仅 Android 支持。</td></tr>
|
|
90
|
+
<tr><td><code>deviceAbi</code></td><td><code>string</code></td><td>否</td><td>设备二进制接口类型,仅 Android 支持。</td></tr>
|
|
91
|
+
<tr><td><code>memorySize</code></td><td><code>string</code></td><td>是</td><td>设备内存大小,单位 MB。</td></tr>
|
|
92
|
+
<tr><td><code>model</code></td><td><code>string</code></td><td>是</td><td>设备型号。</td></tr>
|
|
93
|
+
<tr><td><code>platform</code></td><td><code>string</code></td><td>是</td><td>客户端平台。</td></tr>
|
|
94
|
+
<tr><td><code>system</code></td><td><code>string</code></td><td>是</td><td>操作系统及版本。</td></tr>
|
|
95
|
+
</tbody>
|
|
96
|
+
</table>
|
|
97
|
+
|
|
98
|
+
### 返回示例
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"benchmarkLevel": 30,
|
|
103
|
+
"brand": "Apple",
|
|
104
|
+
"model": "iPhone 15 Pro",
|
|
105
|
+
"system": "iOS 17.5",
|
|
106
|
+
"platform": "ios",
|
|
107
|
+
"memorySize": "8192"
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 平台差异
|
|
112
|
+
|
|
113
|
+
- **Android**:`abi`、`deviceAbi`、`cpuType` 仅 Android 返回
|
|
114
|
+
- **iOS**:不返回 `abi`、`deviceAbi`、`cpuType`
|
|
115
|
+
- **PC**:Flow Web 浏览器的 `platform` 返回 `web`;Windows、macOS 桌面客户端分别返回 `windows`、`mac`,不返回 Android 专属字段
|
|
116
|
+
|
|
117
|
+
<a id="getdeviceinfosync"></a>
|
|
118
|
+
### getDeviceInfoSync()
|
|
119
|
+
|
|
120
|
+
# getDeviceInfoSync
|
|
121
|
+
|
|
122
|
+
同步获取设备基础信息。
|
|
123
|
+
|
|
124
|
+
## 扫码预览
|
|
125
|
+

|
|
126
|
+
|
|
127
|
+
## 支持版本
|
|
128
|
+
|
|
129
|
+
前端库版本不低于 `0.0.32`。
|
|
130
|
+
|
|
131
|
+
## 支持平台
|
|
132
|
+
|
|
133
|
+
<table>
|
|
134
|
+
<thead>
|
|
135
|
+
<tr><th>平台</th><th>支持情况</th></tr>
|
|
136
|
+
</thead>
|
|
137
|
+
<tbody>
|
|
138
|
+
<tr><td>Android</td><td>支持</td></tr>
|
|
139
|
+
<tr><td>iOS</td><td>支持</td></tr>
|
|
140
|
+
<tr><td>PC</td><td>不支持</td></tr>
|
|
141
|
+
<tr><td>HarmonyOS</td><td>不支持</td></tr>
|
|
142
|
+
</tbody>
|
|
143
|
+
</table>
|
|
144
|
+
|
|
145
|
+
## 支持场景
|
|
146
|
+
|
|
147
|
+
<table>
|
|
148
|
+
<thead>
|
|
149
|
+
<tr><th>场景</th><th>支持情况</th></tr>
|
|
150
|
+
</thead>
|
|
151
|
+
<tbody>
|
|
152
|
+
<tr><td>页面</td><td>支持</td></tr>
|
|
153
|
+
<tr><td>卡片</td><td>支持</td></tr>
|
|
154
|
+
</tbody>
|
|
155
|
+
</table>
|
|
156
|
+
|
|
157
|
+
## 使用说明
|
|
158
|
+
|
|
159
|
+
- `platform` 返回小写的客户端平台标识;`benchmarkLevel` 无法获取时返回 -1
|
|
160
|
+
|
|
161
|
+
## 调用方式
|
|
162
|
+
|
|
163
|
+
### 同步 API
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
getDeviceInfoSync(_params?: object): GetDeviceInfoResult
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## 入参
|
|
170
|
+
|
|
171
|
+
无。
|
|
172
|
+
|
|
173
|
+
## 调用示例
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
import { getDeviceInfoSync } from '@doubao-dev/framework/api';
|
|
177
|
+
|
|
178
|
+
const result = getDeviceInfoSync();
|
|
179
|
+
|
|
180
|
+
console.log(result.brand, result.model, result.system);
|
|
181
|
+
console.log(result.platform, result.benchmarkLevel);
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## 返回值
|
|
185
|
+
|
|
186
|
+
<table>
|
|
187
|
+
<thead>
|
|
188
|
+
<tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
|
|
189
|
+
</thead>
|
|
190
|
+
<tbody>
|
|
191
|
+
<tr><td><code>abi</code></td><td><code>string</code></td><td>否</td><td>豆包客户端二进制接口类型,仅 Android 支持。</td></tr>
|
|
192
|
+
<tr><td><code>benchmarkLevel</code></td><td><code>number</code></td><td>是</td><td>设备性能等级,值越高性能越好;-1 表示未知。</td></tr>
|
|
193
|
+
<tr><td><code>brand</code></td><td><code>string</code></td><td>是</td><td>设备品牌。</td></tr>
|
|
194
|
+
<tr><td><code>cpuType</code></td><td><code>string</code></td><td>否</td><td>设备 CPU 型号,仅 Android 支持。</td></tr>
|
|
195
|
+
<tr><td><code>deviceAbi</code></td><td><code>string</code></td><td>否</td><td>设备二进制接口类型,仅 Android 支持。</td></tr>
|
|
196
|
+
<tr><td><code>memorySize</code></td><td><code>string</code></td><td>是</td><td>设备内存大小,单位 MB。</td></tr>
|
|
197
|
+
<tr><td><code>model</code></td><td><code>string</code></td><td>是</td><td>设备型号。</td></tr>
|
|
198
|
+
<tr><td><code>platform</code></td><td><code>string</code></td><td>是</td><td>客户端平台。</td></tr>
|
|
199
|
+
<tr><td><code>system</code></td><td><code>string</code></td><td>是</td><td>操作系统及版本。</td></tr>
|
|
200
|
+
</tbody>
|
|
201
|
+
</table>
|
|
202
|
+
|
|
203
|
+
### 返回示例
|
|
204
|
+
|
|
205
|
+
```json
|
|
206
|
+
{
|
|
207
|
+
"benchmarkLevel": 30,
|
|
208
|
+
"brand": "Apple",
|
|
209
|
+
"model": "iPhone 15 Pro",
|
|
210
|
+
"system": "iOS 17.5",
|
|
211
|
+
"platform": "ios",
|
|
212
|
+
"memorySize": "8192"
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## 平台差异
|
|
217
|
+
|
|
218
|
+
- **Android**:`abi`、`deviceAbi`、`cpuType` 为可选字段,豆包无法获取时不返回
|
|
219
|
+
- **iOS**:不返回 `abi`、`deviceAbi`、`cpuType`
|
|
220
|
+
|
|
221
|
+
## 相关类型
|
|
222
|
+
|
|
223
|
+
<a id="getdeviceinforesult"></a>
|
|
224
|
+
### GetDeviceInfoResult
|
|
225
|
+
|
|
226
|
+
设备基础信息。
|
|
227
|
+
|
|
228
|
+
#### Properties
|
|
229
|
+
|
|
230
|
+
• **abi?**: `string` - 豆包客户端二进制接口类型,仅 Android 支持
|
|
231
|
+
• **deviceAbi?**: `string` - 设备二进制接口类型,仅 Android 支持
|
|
232
|
+
• **benchmarkLevel**: `number` - 设备性能等级,值越高性能越好;-1 表示未知
|
|
233
|
+
• **brand**: `string` - 设备品牌
|
|
234
|
+
• **model**: `string` - 设备型号
|
|
235
|
+
• **system**: `string` - 操作系统及版本
|
|
236
|
+
• **platform**: `string` - 客户端平台
|
|
237
|
+
• **cpuType?**: `string` - 设备 CPU 型号,仅 Android 支持
|
|
238
|
+
• **memorySize**: `string` - 设备内存大小,单位 MB
|