@doubao-dev/plugin-app-dev 1.0.0-rc.2 → 1.0.0-rc.20
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 +1 -1
- package/dist/plugin.d.ts +2 -4
- package/dist/plugin.js +6 -6
- package/dist/rslib-runtime.js +1 -1
- package/dist/skills/doubao-plugin-app/SKILL.md +7 -9
- package/dist/skills/doubao-plugin-app/references/app/app-development.md +88 -0
- package/dist/skills/doubao-plugin-app/references/app/tools-and-cards.md +79 -0
- package/dist/skills/doubao-plugin-app/references/app/ui-design.md +32 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/02-/347/263/273/347/273/237.md +458 -33
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/07-/347/225/214/351/235/242.md +1 -1
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/11-/345/252/222/344/275/223.md +299 -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 +11 -6
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/36-/347/224/273/345/270/203.md +177 -0
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/groups.md +4 -3
- package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/quick-reference.md +16 -2
- package/dist/skills/doubao-plugin-app/references/frontend/widget-templates/props.md +12 -8
- package/dist/templates/README.md.template +1 -1
- package/package.json +6 -11
- package/dist/skills/doubao-plugin-app/references/app-development.md +0 -90
- package/dist/skills/doubao-plugin-app/references/tools-and-cards.md +0 -47
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
| API | 说明 |
|
|
10
10
|
| --- | --- |
|
|
11
|
+
| [getContainerInfoSync](#getcontainerinfosync) | 同步获取当前渲染容器的尺寸信息。 同时支持 Page(含全屏、半屏)和 Widget(卡片)容器。<br><br>同步 API。 |
|
|
12
|
+
| [getContainerInfo](#getcontainerinfo) | 异步获取当前渲染容器的尺寸信息。 同时支持 Page(含全屏、半屏)和 Widget(卡片)容器。 |
|
|
13
|
+
| [onContainerResize](#oncontainerresize) | 监听当前渲染容器尺寸变化。 使用与 getContainerInfoSync 相同的数据源,仅在容器宽度或高度变化时触发,注册时不触发回调。<br><br>返回取消监听函数。 |
|
|
11
14
|
| [getWindowInfoSync](#getwindowinfosync) | 获取窗口信息。<br><br>同步 API。 |
|
|
12
15
|
| [getSystemSetting](#getsystemsetting) | 获取设备设置。 |
|
|
13
16
|
| [getAppAuthorizeSetting](#getappauthorizesetting) | 获取豆包客户端的系统授权设置。 调用只读取当前系统授权状态,不会申请权限或触发系统授权弹窗。原有状态字段固定返回 authorized、denied 或 not determined,精细授权字段用于区分部分、只读、只写、前后台等能力。 |
|
|
@@ -17,9 +20,280 @@
|
|
|
17
20
|
| [onThemeChange](#onthemechange) | 监听应用主题变化。 当用户在系统设置或豆包客户端内切换浅色、深色主题时触发。回调参数中的 theme 表示切换后的主题,可与 getAppBaseInfo 返回的 theme 字段配合使用。<br><br>返回取消监听函数。 |
|
|
18
21
|
| [getSystemInfo](#getsysteminfo) | 获取系统信息。 |
|
|
19
22
|
| [getSystemInfoSync](#getsysteminfosync) | 同步获取系统信息。<br><br>同步 API。 |
|
|
23
|
+
| [onWindowResize](#onwindowresize) | 监听当前窗口尺寸变化。 使用与 getWindowInfoSync 相同的数据源,仅在窗口宽度或高度变化时触发,注册时不触发回调。<br><br>返回取消监听函数。 |
|
|
20
24
|
|
|
21
25
|
## API 详情
|
|
22
26
|
|
|
27
|
+
<a id="getcontainerinfosync"></a>
|
|
28
|
+
### getContainerInfoSync()
|
|
29
|
+
|
|
30
|
+
# getContainerInfoSync
|
|
31
|
+
|
|
32
|
+
同步获取当前渲染容器的尺寸信息。
|
|
33
|
+
|
|
34
|
+
同时支持 Page(含全屏、半屏)和 Widget(卡片)容器。
|
|
35
|
+
|
|
36
|
+
## 支持版本
|
|
37
|
+
|
|
38
|
+
前端库版本不低于 `0.11.0`。
|
|
39
|
+
|
|
40
|
+
## 支持平台
|
|
41
|
+
|
|
42
|
+
<table>
|
|
43
|
+
<thead>
|
|
44
|
+
<tr><th>平台</th><th>支持情况</th></tr>
|
|
45
|
+
</thead>
|
|
46
|
+
<tbody>
|
|
47
|
+
<tr><td>Android</td><td>支持</td></tr>
|
|
48
|
+
<tr><td>iOS</td><td>支持</td></tr>
|
|
49
|
+
<tr><td>PC</td><td>不支持</td></tr>
|
|
50
|
+
<tr><td>HarmonyOS</td><td>不支持</td></tr>
|
|
51
|
+
</tbody>
|
|
52
|
+
</table>
|
|
53
|
+
|
|
54
|
+
## 支持场景
|
|
55
|
+
|
|
56
|
+
<table>
|
|
57
|
+
<thead>
|
|
58
|
+
<tr><th>场景</th><th>支持情况</th></tr>
|
|
59
|
+
</thead>
|
|
60
|
+
<tbody>
|
|
61
|
+
<tr><td>页面</td><td>支持</td></tr>
|
|
62
|
+
<tr><td>卡片</td><td>支持</td></tr>
|
|
63
|
+
</tbody>
|
|
64
|
+
</table>
|
|
65
|
+
|
|
66
|
+
## 使用说明
|
|
67
|
+
|
|
68
|
+
- Widget 首屏渲染前测量完成时 height 可能为 0,需结合 onContainerResize 或 useContainerInfo 感知变化。
|
|
69
|
+
|
|
70
|
+
## 调用方式
|
|
71
|
+
|
|
72
|
+
### 同步 API
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
getContainerInfoSync(_params?: object): GetContainerInfoResult
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 入参
|
|
79
|
+
|
|
80
|
+
无。
|
|
81
|
+
|
|
82
|
+
## 调用示例
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { getContainerInfoSync } from '@doubao-dev/framework/api';
|
|
86
|
+
|
|
87
|
+
const info = getContainerInfoSync();
|
|
88
|
+
console.log(info.containerType, info.width, info.height);
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 返回值
|
|
92
|
+
|
|
93
|
+
<table>
|
|
94
|
+
<thead>
|
|
95
|
+
<tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
|
|
96
|
+
</thead>
|
|
97
|
+
<tbody>
|
|
98
|
+
<tr><td><code>containerType</code></td><td><code>ContainerType</code></td><td>是</td><td>当前容器类型</td></tr>
|
|
99
|
+
<tr><td><code>height</code></td><td><code>number</code></td><td>是</td><td>当前容器高度,单位为逻辑像素;Widget 首屏渲染前未测量完成时可能为 0</td></tr>
|
|
100
|
+
<tr><td><code>pixelRatio</code></td><td><code>number</code></td><td>是</td><td>设备像素比,物理像素 = 逻辑像素 × pixelRatio</td></tr>
|
|
101
|
+
<tr><td><code>width</code></td><td><code>number</code></td><td>是</td><td>当前容器可用宽度,单位为逻辑像素;Page 为窗口或半屏宽度,Widget 为卡片容器宽度</td></tr>
|
|
102
|
+
</tbody>
|
|
103
|
+
</table>
|
|
104
|
+
|
|
105
|
+
### 返回示例
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"containerType": "widget",
|
|
110
|
+
"width": 328,
|
|
111
|
+
"height": 200,
|
|
112
|
+
"pixelRatio": 3
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
<a id="getcontainerinfo"></a>
|
|
117
|
+
### getContainerInfo()
|
|
118
|
+
|
|
119
|
+
# getContainerInfo
|
|
120
|
+
|
|
121
|
+
异步获取当前渲染容器的尺寸信息。
|
|
122
|
+
|
|
123
|
+
同时支持 Page(含全屏、半屏)和 Widget(卡片)容器。
|
|
124
|
+
|
|
125
|
+
## 支持版本
|
|
126
|
+
|
|
127
|
+
前端库版本不低于 `0.11.0`。
|
|
128
|
+
|
|
129
|
+
## 支持平台
|
|
130
|
+
|
|
131
|
+
<table>
|
|
132
|
+
<thead>
|
|
133
|
+
<tr><th>平台</th><th>支持情况</th></tr>
|
|
134
|
+
</thead>
|
|
135
|
+
<tbody>
|
|
136
|
+
<tr><td>Android</td><td>支持</td></tr>
|
|
137
|
+
<tr><td>iOS</td><td>支持</td></tr>
|
|
138
|
+
<tr><td>PC</td><td>不支持</td></tr>
|
|
139
|
+
<tr><td>HarmonyOS</td><td>不支持</td></tr>
|
|
140
|
+
</tbody>
|
|
141
|
+
</table>
|
|
142
|
+
|
|
143
|
+
## 支持场景
|
|
144
|
+
|
|
145
|
+
<table>
|
|
146
|
+
<thead>
|
|
147
|
+
<tr><th>场景</th><th>支持情况</th></tr>
|
|
148
|
+
</thead>
|
|
149
|
+
<tbody>
|
|
150
|
+
<tr><td>页面</td><td>支持</td></tr>
|
|
151
|
+
<tr><td>卡片</td><td>支持</td></tr>
|
|
152
|
+
</tbody>
|
|
153
|
+
</table>
|
|
154
|
+
|
|
155
|
+
## 使用说明
|
|
156
|
+
|
|
157
|
+
- 该接口封装 getContainerInfoSync 的结果;无需 Promise 形式时可直接使用 getContainerInfoSync。
|
|
158
|
+
|
|
159
|
+
## 调用方式
|
|
160
|
+
|
|
161
|
+
### 异步 API
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
getContainerInfo(_params?: object): Promise<GetContainerInfoResult>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## 入参
|
|
168
|
+
|
|
169
|
+
无。
|
|
170
|
+
|
|
171
|
+
## 调用示例
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
import { getContainerInfo } from '@doubao-dev/framework/api';
|
|
175
|
+
|
|
176
|
+
const info = await getContainerInfo();
|
|
177
|
+
console.log(info.containerType, info.width, info.height);
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## 成功返回
|
|
181
|
+
|
|
182
|
+
<table>
|
|
183
|
+
<thead>
|
|
184
|
+
<tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
|
|
185
|
+
</thead>
|
|
186
|
+
<tbody>
|
|
187
|
+
<tr><td><code>containerType</code></td><td><code>ContainerType</code></td><td>是</td><td>当前容器类型</td></tr>
|
|
188
|
+
<tr><td><code>height</code></td><td><code>number</code></td><td>是</td><td>当前容器高度,单位为逻辑像素;Widget 首屏渲染前未测量完成时可能为 0</td></tr>
|
|
189
|
+
<tr><td><code>pixelRatio</code></td><td><code>number</code></td><td>是</td><td>设备像素比,物理像素 = 逻辑像素 × pixelRatio</td></tr>
|
|
190
|
+
<tr><td><code>width</code></td><td><code>number</code></td><td>是</td><td>当前容器可用宽度,单位为逻辑像素;Page 为窗口或半屏宽度,Widget 为卡片容器宽度</td></tr>
|
|
191
|
+
</tbody>
|
|
192
|
+
</table>
|
|
193
|
+
|
|
194
|
+
### 返回示例
|
|
195
|
+
|
|
196
|
+
```json
|
|
197
|
+
{
|
|
198
|
+
"containerType": "widget",
|
|
199
|
+
"width": 328,
|
|
200
|
+
"height": 200,
|
|
201
|
+
"pixelRatio": 3
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
<a id="oncontainerresize"></a>
|
|
206
|
+
### onContainerResize()
|
|
207
|
+
|
|
208
|
+
# onContainerResize
|
|
209
|
+
|
|
210
|
+
监听当前渲染容器尺寸变化。
|
|
211
|
+
|
|
212
|
+
使用与 getContainerInfoSync 相同的数据源,仅在容器宽度或高度变化时触发,注册时不触发回调。
|
|
213
|
+
|
|
214
|
+
## 支持版本
|
|
215
|
+
|
|
216
|
+
前端库版本不低于 `0.11.0`。
|
|
217
|
+
|
|
218
|
+
## 支持平台
|
|
219
|
+
|
|
220
|
+
<table>
|
|
221
|
+
<thead>
|
|
222
|
+
<tr><th>平台</th><th>支持情况</th></tr>
|
|
223
|
+
</thead>
|
|
224
|
+
<tbody>
|
|
225
|
+
<tr><td>Android</td><td>支持</td></tr>
|
|
226
|
+
<tr><td>iOS</td><td>支持</td></tr>
|
|
227
|
+
<tr><td>PC</td><td>不支持</td></tr>
|
|
228
|
+
<tr><td>HarmonyOS</td><td>不支持</td></tr>
|
|
229
|
+
</tbody>
|
|
230
|
+
</table>
|
|
231
|
+
|
|
232
|
+
## 支持场景
|
|
233
|
+
|
|
234
|
+
<table>
|
|
235
|
+
<thead>
|
|
236
|
+
<tr><th>场景</th><th>支持情况</th></tr>
|
|
237
|
+
</thead>
|
|
238
|
+
<tbody>
|
|
239
|
+
<tr><td>页面</td><td>支持</td></tr>
|
|
240
|
+
<tr><td>卡片</td><td>支持</td></tr>
|
|
241
|
+
</tbody>
|
|
242
|
+
</table>
|
|
243
|
+
|
|
244
|
+
## 使用说明
|
|
245
|
+
|
|
246
|
+
- 注册时不会立即触发回调;若需在首屏异步测量场景同步初始尺寸,请配合 getContainerInfoSync 或直接改用 useContainerInfo;不再需要监听时调用返回的函数取消监听。
|
|
247
|
+
|
|
248
|
+
## 调用方式
|
|
249
|
+
|
|
250
|
+
### 事件监听 API
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
onContainerResize(callback: ContainerResizeListener): () => void
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## 入参
|
|
257
|
+
|
|
258
|
+
无。
|
|
259
|
+
|
|
260
|
+
## 调用示例
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
import { onContainerResize } from '@doubao-dev/framework/api';
|
|
264
|
+
|
|
265
|
+
const offContainerResize = onContainerResize(({ width, height }) => {
|
|
266
|
+
console.log(width, height);
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
offContainerResize();
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## 回调参数
|
|
273
|
+
|
|
274
|
+
<table>
|
|
275
|
+
<thead>
|
|
276
|
+
<tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
|
|
277
|
+
</thead>
|
|
278
|
+
<tbody>
|
|
279
|
+
<tr><td><code>event.height</code></td><td><code>number</code></td><td>是</td><td>变化后的容器高度,单位为逻辑像素。</td></tr>
|
|
280
|
+
<tr><td><code>event.width</code></td><td><code>number</code></td><td>是</td><td>变化后的容器宽度,单位为逻辑像素。</td></tr>
|
|
281
|
+
</tbody>
|
|
282
|
+
</table>
|
|
283
|
+
|
|
284
|
+
## 返回值
|
|
285
|
+
|
|
286
|
+
取消当前监听的函数。
|
|
287
|
+
|
|
288
|
+
### 回调示例
|
|
289
|
+
|
|
290
|
+
```json
|
|
291
|
+
{
|
|
292
|
+
"width": 328,
|
|
293
|
+
"height": 200
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
23
297
|
<a id="getwindowinfosync"></a>
|
|
24
298
|
### getWindowInfoSync()
|
|
25
299
|
|
|
@@ -430,14 +704,14 @@ console.log(result.healthDataAuthorizationDetail?.readStatus);
|
|
|
430
704
|
|
|
431
705
|
## 使用说明
|
|
432
706
|
|
|
433
|
-
-
|
|
707
|
+
- 同步桥接调用失败时抛出桥接错误。
|
|
434
708
|
|
|
435
709
|
## 调用方式
|
|
436
710
|
|
|
437
711
|
### 同步 API
|
|
438
712
|
|
|
439
713
|
```typescript
|
|
440
|
-
getAppBaseInfoSync(
|
|
714
|
+
getAppBaseInfoSync(params?: object): GetAppBaseInfoResult
|
|
441
715
|
```
|
|
442
716
|
|
|
443
717
|
## 入参
|
|
@@ -462,12 +736,12 @@ console.log(result.host?.appId);
|
|
|
462
736
|
<tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
|
|
463
737
|
</thead>
|
|
464
738
|
<tbody>
|
|
465
|
-
<tr><td><code>enableDebug</code></td><td><code>boolean</code></td><td>否</td><td
|
|
739
|
+
<tr><td><code>enableDebug</code></td><td><code>boolean</code></td><td>否</td><td>豆包客户端是否为调试构建</td></tr>
|
|
466
740
|
<tr><td><code>host</code></td><td><code>AppBaseInfoHost</code></td><td>否</td><td>当前豆包客户端信息</td></tr>
|
|
467
|
-
<tr><td><code>host.appId</code></td><td><code>string</code></td><td>否</td><td
|
|
468
|
-
<tr><td><code>language</code></td><td><code>string</code></td><td>是</td><td
|
|
741
|
+
<tr><td><code>host.appId</code></td><td><code>string</code></td><td>否</td><td>豆包客户端应用标识(AID)</td></tr>
|
|
742
|
+
<tr><td><code>language</code></td><td><code>string</code></td><td>是</td><td>豆包客户端当前使用的语言</td></tr>
|
|
469
743
|
<tr><td><code>SDKVersion</code></td><td><code>string</code></td><td>否</td><td>客户端基础库版本</td></tr>
|
|
470
|
-
<tr><td><code>theme</code></td><td><code>"light" | "dark"</code></td><td>否</td><td
|
|
744
|
+
<tr><td><code>theme</code></td><td><code>"light" | "dark"</code></td><td>否</td><td>当前应用插件使用的主题</td></tr>
|
|
471
745
|
<tr><td><code>version</code></td><td><code>string</code></td><td>否</td><td>豆包客户端版本号</td></tr>
|
|
472
746
|
</tbody>
|
|
473
747
|
</table>
|
|
@@ -478,7 +752,7 @@ console.log(result.host?.appId);
|
|
|
478
752
|
{
|
|
479
753
|
"SDKVersion": "0.0.36",
|
|
480
754
|
"host": {
|
|
481
|
-
"appId": "
|
|
755
|
+
"appId": "482431"
|
|
482
756
|
},
|
|
483
757
|
"language": "zh_CN",
|
|
484
758
|
"version": "8.0.0",
|
|
@@ -609,11 +883,6 @@ console.log(result.safeArea?.top, result.screenTop);
|
|
|
609
883
|
## 扫码预览
|
|
610
884
|

|
|
611
885
|
|
|
612
|
-
## 使用限制
|
|
613
|
-
|
|
614
|
-
> [!WARNING]
|
|
615
|
-
> **iOS**:iOS 仅提供接口声明未注册实现,调用直接返回不支持;iOS 上的异步调用无法获得成功结果。
|
|
616
|
-
|
|
617
886
|
## 支持版本
|
|
618
887
|
|
|
619
888
|
前端库版本不低于 `0.0.18`。
|
|
@@ -626,7 +895,7 @@ console.log(result.safeArea?.top, result.screenTop);
|
|
|
626
895
|
</thead>
|
|
627
896
|
<tbody>
|
|
628
897
|
<tr><td>Android</td><td>支持</td></tr>
|
|
629
|
-
<tr><td>iOS</td><td
|
|
898
|
+
<tr><td>iOS</td><td>支持</td></tr>
|
|
630
899
|
<tr><td>PC</td><td>不支持</td></tr>
|
|
631
900
|
<tr><td>HarmonyOS</td><td>不支持</td></tr>
|
|
632
901
|
</tbody>
|
|
@@ -646,7 +915,7 @@ console.log(result.safeArea?.top, result.screenTop);
|
|
|
646
915
|
|
|
647
916
|
## 使用说明
|
|
648
917
|
|
|
649
|
-
-
|
|
918
|
+
- 同步调用请使用 getAppBaseInfoSync。
|
|
650
919
|
|
|
651
920
|
## 调用方式
|
|
652
921
|
|
|
@@ -678,12 +947,12 @@ console.log(result.host?.appId, result.enableDebug);
|
|
|
678
947
|
<tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
|
|
679
948
|
</thead>
|
|
680
949
|
<tbody>
|
|
681
|
-
<tr><td><code>enableDebug</code></td><td><code>boolean</code></td><td>否</td><td
|
|
950
|
+
<tr><td><code>enableDebug</code></td><td><code>boolean</code></td><td>否</td><td>豆包客户端是否为调试构建</td></tr>
|
|
682
951
|
<tr><td><code>host</code></td><td><code>AppBaseInfoHost</code></td><td>否</td><td>当前豆包客户端信息</td></tr>
|
|
683
|
-
<tr><td><code>host.appId</code></td><td><code>string</code></td><td>否</td><td
|
|
684
|
-
<tr><td><code>language</code></td><td><code>string</code></td><td>是</td><td
|
|
952
|
+
<tr><td><code>host.appId</code></td><td><code>string</code></td><td>否</td><td>豆包客户端应用标识(AID)</td></tr>
|
|
953
|
+
<tr><td><code>language</code></td><td><code>string</code></td><td>是</td><td>豆包客户端当前使用的语言</td></tr>
|
|
685
954
|
<tr><td><code>SDKVersion</code></td><td><code>string</code></td><td>否</td><td>客户端基础库版本</td></tr>
|
|
686
|
-
<tr><td><code>theme</code></td><td><code>"light" | "dark"</code></td><td>否</td><td
|
|
955
|
+
<tr><td><code>theme</code></td><td><code>"light" | "dark"</code></td><td>否</td><td>当前应用插件使用的主题</td></tr>
|
|
687
956
|
<tr><td><code>version</code></td><td><code>string</code></td><td>否</td><td>豆包客户端版本号</td></tr>
|
|
688
957
|
</tbody>
|
|
689
958
|
</table>
|
|
@@ -694,7 +963,7 @@ console.log(result.host?.appId, result.enableDebug);
|
|
|
694
963
|
{
|
|
695
964
|
"SDKVersion": "0.0.36",
|
|
696
965
|
"host": {
|
|
697
|
-
"appId": "
|
|
966
|
+
"appId": "482431"
|
|
698
967
|
},
|
|
699
968
|
"language": "zh_CN",
|
|
700
969
|
"version": "8.0.0",
|
|
@@ -874,8 +1143,8 @@ console.log(result.screenWidth, result.screenHeight);
|
|
|
874
1143
|
<tr><td><code>benchmarkLevel</code></td><td><code>number</code></td><td>否</td><td>设备性能等级,-1 表示未知</td></tr>
|
|
875
1144
|
<tr><td><code>brand</code></td><td><code>string</code></td><td>是</td><td>设备品牌</td></tr>
|
|
876
1145
|
<tr><td><code>deviceOrientation</code></td><td><code>"portrait" | "landscape"</code></td><td>否</td><td>设备方向</td></tr>
|
|
877
|
-
<tr><td><code>enableDebug</code></td><td><code>boolean</code></td><td>否</td><td
|
|
878
|
-
<tr><td><code>language</code></td><td><code>string</code></td><td>是</td><td
|
|
1146
|
+
<tr><td><code>enableDebug</code></td><td><code>boolean</code></td><td>否</td><td>豆包客户端是否为调试构建</td></tr>
|
|
1147
|
+
<tr><td><code>language</code></td><td><code>string</code></td><td>是</td><td>豆包客户端当前使用的语言</td></tr>
|
|
879
1148
|
<tr><td><code>model</code></td><td><code>string</code></td><td>是</td><td>设备型号</td></tr>
|
|
880
1149
|
<tr><td><code>pixelRatio</code></td><td><code>number</code></td><td>是</td><td>设备像素比,物理像素 = 逻辑像素 × pixelRatio</td></tr>
|
|
881
1150
|
<tr><td><code>platform</code></td><td><code>string</code></td><td>是</td><td>客户端平台,取值为 "ios" 或 "android"</td></tr>
|
|
@@ -891,7 +1160,7 @@ console.log(result.screenWidth, result.screenHeight);
|
|
|
891
1160
|
<tr><td><code>SDKVersion</code></td><td><code>string</code></td><td>否</td><td>客户端基础库版本</td></tr>
|
|
892
1161
|
<tr><td><code>statusBarHeight</code></td><td><code>number</code></td><td>是</td><td>状态栏高度,单位为逻辑像素</td></tr>
|
|
893
1162
|
<tr><td><code>system</code></td><td><code>string</code></td><td>是</td><td>操作系统及版本,如 "Android 14"、"iOS 17.5"</td></tr>
|
|
894
|
-
<tr><td><code>theme</code></td><td><code>"light" | "dark"</code></td><td>否</td><td
|
|
1163
|
+
<tr><td><code>theme</code></td><td><code>"light" | "dark"</code></td><td>否</td><td>当前应用插件使用的主题</td></tr>
|
|
895
1164
|
<tr><td><code>version</code></td><td><code>string</code></td><td>否</td><td>豆包客户端版本号</td></tr>
|
|
896
1165
|
<tr><td><code>windowHeight</code></td><td><code>number</code></td><td>是</td><td>可使用窗口高度,单位为逻辑像素</td></tr>
|
|
897
1166
|
<tr><td><code>windowWidth</code></td><td><code>number</code></td><td>是</td><td>可使用窗口宽度,单位为逻辑像素</td></tr>
|
|
@@ -994,7 +1263,7 @@ console.log(result.screenWidth, result.screenHeight);
|
|
|
994
1263
|
### 同步 API
|
|
995
1264
|
|
|
996
1265
|
```typescript
|
|
997
|
-
getSystemInfoSync(
|
|
1266
|
+
getSystemInfoSync(params?: object): GetSystemInfoResult
|
|
998
1267
|
```
|
|
999
1268
|
|
|
1000
1269
|
## 入参
|
|
@@ -1023,8 +1292,8 @@ console.log(result.screenWidth, result.screenHeight);
|
|
|
1023
1292
|
<tr><td><code>benchmarkLevel</code></td><td><code>number</code></td><td>否</td><td>设备性能等级,-1 表示未知</td></tr>
|
|
1024
1293
|
<tr><td><code>brand</code></td><td><code>string</code></td><td>是</td><td>设备品牌</td></tr>
|
|
1025
1294
|
<tr><td><code>deviceOrientation</code></td><td><code>"portrait" | "landscape"</code></td><td>否</td><td>设备方向</td></tr>
|
|
1026
|
-
<tr><td><code>enableDebug</code></td><td><code>boolean</code></td><td>否</td><td
|
|
1027
|
-
<tr><td><code>language</code></td><td><code>string</code></td><td>是</td><td
|
|
1295
|
+
<tr><td><code>enableDebug</code></td><td><code>boolean</code></td><td>否</td><td>豆包客户端是否为调试构建</td></tr>
|
|
1296
|
+
<tr><td><code>language</code></td><td><code>string</code></td><td>是</td><td>豆包客户端当前使用的语言</td></tr>
|
|
1028
1297
|
<tr><td><code>model</code></td><td><code>string</code></td><td>是</td><td>设备型号</td></tr>
|
|
1029
1298
|
<tr><td><code>pixelRatio</code></td><td><code>number</code></td><td>是</td><td>设备像素比,物理像素 = 逻辑像素 × pixelRatio</td></tr>
|
|
1030
1299
|
<tr><td><code>platform</code></td><td><code>string</code></td><td>是</td><td>客户端平台,取值为 "ios" 或 "android"</td></tr>
|
|
@@ -1040,7 +1309,7 @@ console.log(result.screenWidth, result.screenHeight);
|
|
|
1040
1309
|
<tr><td><code>SDKVersion</code></td><td><code>string</code></td><td>否</td><td>客户端基础库版本</td></tr>
|
|
1041
1310
|
<tr><td><code>statusBarHeight</code></td><td><code>number</code></td><td>是</td><td>状态栏高度,单位为逻辑像素</td></tr>
|
|
1042
1311
|
<tr><td><code>system</code></td><td><code>string</code></td><td>是</td><td>操作系统及版本,如 "Android 14"、"iOS 17.5"</td></tr>
|
|
1043
|
-
<tr><td><code>theme</code></td><td><code>"light" | "dark"</code></td><td>否</td><td
|
|
1312
|
+
<tr><td><code>theme</code></td><td><code>"light" | "dark"</code></td><td>否</td><td>当前应用插件使用的主题</td></tr>
|
|
1044
1313
|
<tr><td><code>version</code></td><td><code>string</code></td><td>否</td><td>豆包客户端版本号</td></tr>
|
|
1045
1314
|
<tr><td><code>windowHeight</code></td><td><code>number</code></td><td>是</td><td>可使用窗口高度,单位为逻辑像素</td></tr>
|
|
1046
1315
|
<tr><td><code>windowWidth</code></td><td><code>number</code></td><td>是</td><td>可使用窗口宽度,单位为逻辑像素</td></tr>
|
|
@@ -1101,8 +1370,141 @@ console.log(result.screenWidth, result.screenHeight);
|
|
|
1101
1370
|
|
|
1102
1371
|
- **Android**:abi 返回豆包客户端二进制接口类型(如 arm64-v8a),iOS 不返回该字段
|
|
1103
1372
|
|
|
1373
|
+
<a id="onwindowresize"></a>
|
|
1374
|
+
### onWindowResize()
|
|
1375
|
+
|
|
1376
|
+
# onWindowResize
|
|
1377
|
+
|
|
1378
|
+
监听当前窗口尺寸变化。
|
|
1379
|
+
|
|
1380
|
+
使用与 getWindowInfoSync 相同的数据源,仅在窗口宽度或高度变化时触发,注册时不触发回调。
|
|
1381
|
+
|
|
1382
|
+
## 支持版本
|
|
1383
|
+
|
|
1384
|
+
前端库版本不低于 `0.10.0`。
|
|
1385
|
+
|
|
1386
|
+
## 支持平台
|
|
1387
|
+
|
|
1388
|
+
<table>
|
|
1389
|
+
<thead>
|
|
1390
|
+
<tr><th>平台</th><th>支持情况</th></tr>
|
|
1391
|
+
</thead>
|
|
1392
|
+
<tbody>
|
|
1393
|
+
<tr><td>Android</td><td>支持</td></tr>
|
|
1394
|
+
<tr><td>iOS</td><td>支持</td></tr>
|
|
1395
|
+
<tr><td>PC</td><td>不支持</td></tr>
|
|
1396
|
+
<tr><td>HarmonyOS</td><td>不支持</td></tr>
|
|
1397
|
+
</tbody>
|
|
1398
|
+
</table>
|
|
1399
|
+
|
|
1400
|
+
## 支持场景
|
|
1401
|
+
|
|
1402
|
+
<table>
|
|
1403
|
+
<thead>
|
|
1404
|
+
<tr><th>场景</th><th>支持情况</th></tr>
|
|
1405
|
+
</thead>
|
|
1406
|
+
<tbody>
|
|
1407
|
+
<tr><td>页面</td><td>支持</td></tr>
|
|
1408
|
+
<tr><td>卡片</td><td>不支持</td></tr>
|
|
1409
|
+
</tbody>
|
|
1410
|
+
</table>
|
|
1411
|
+
|
|
1412
|
+
## 使用说明
|
|
1413
|
+
|
|
1414
|
+
- 注册时不会立即触发回调;不再需要监听时,调用返回的函数取消监听。
|
|
1415
|
+
|
|
1416
|
+
## 调用方式
|
|
1417
|
+
|
|
1418
|
+
### 事件监听 API
|
|
1419
|
+
|
|
1420
|
+
```typescript
|
|
1421
|
+
onWindowResize(callback: WindowResizeListener): () => void
|
|
1422
|
+
```
|
|
1423
|
+
|
|
1424
|
+
## 入参
|
|
1425
|
+
|
|
1426
|
+
无。
|
|
1427
|
+
|
|
1428
|
+
## 调用示例
|
|
1429
|
+
|
|
1430
|
+
```typescript
|
|
1431
|
+
import { onWindowResize } from '@doubao-dev/framework/api';
|
|
1432
|
+
|
|
1433
|
+
const offWindowResize = onWindowResize(({ size }) => {
|
|
1434
|
+
console.log(size.windowWidth, size.windowHeight);
|
|
1435
|
+
});
|
|
1436
|
+
|
|
1437
|
+
offWindowResize();
|
|
1438
|
+
```
|
|
1439
|
+
|
|
1440
|
+
## 回调参数
|
|
1441
|
+
|
|
1442
|
+
<table>
|
|
1443
|
+
<thead>
|
|
1444
|
+
<tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
|
|
1445
|
+
</thead>
|
|
1446
|
+
<tbody>
|
|
1447
|
+
<tr><td><code>event.size</code></td><td><code>object</code></td><td>是</td><td>变化后的窗口尺寸,单位为逻辑像素。</td></tr>
|
|
1448
|
+
<tr><td><code>event.size.windowHeight</code></td><td><code>number</code></td><td>是</td><td>窗口高度。</td></tr>
|
|
1449
|
+
<tr><td><code>event.size.windowWidth</code></td><td><code>number</code></td><td>是</td><td>窗口宽度。</td></tr>
|
|
1450
|
+
</tbody>
|
|
1451
|
+
</table>
|
|
1452
|
+
|
|
1453
|
+
## 返回值
|
|
1454
|
+
|
|
1455
|
+
取消当前监听的函数。
|
|
1456
|
+
|
|
1457
|
+
### 回调示例
|
|
1458
|
+
|
|
1459
|
+
```json
|
|
1460
|
+
{
|
|
1461
|
+
"size": {
|
|
1462
|
+
"windowWidth": 393,
|
|
1463
|
+
"windowHeight": 852
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
```
|
|
1467
|
+
|
|
1104
1468
|
## 相关类型
|
|
1105
1469
|
|
|
1470
|
+
<a id="containertype"></a>
|
|
1471
|
+
### ContainerType
|
|
1472
|
+
|
|
1473
|
+
容器类型。
|
|
1474
|
+
|
|
1475
|
+
#### Type
|
|
1476
|
+
|
|
1477
|
+
`'page' | 'widget'`
|
|
1478
|
+
|
|
1479
|
+
<a id="getcontainerinforesult"></a>
|
|
1480
|
+
### GetContainerInfoResult
|
|
1481
|
+
|
|
1482
|
+
#### Properties
|
|
1483
|
+
|
|
1484
|
+
• **containerType**: `ContainerType` - 当前容器类型
|
|
1485
|
+
• **width**: `number` - 当前容器可用宽度,单位为逻辑像素;Page 为窗口或半屏宽度,Widget 为卡片容器宽度
|
|
1486
|
+
• **height**: `number` - 当前容器高度,单位为逻辑像素;Widget 首屏渲染前未测量完成时可能为 0
|
|
1487
|
+
• **pixelRatio**: `number` - 设备像素比,物理像素 = 逻辑像素 × pixelRatio
|
|
1488
|
+
|
|
1489
|
+
<a id="containerresizelistener"></a>
|
|
1490
|
+
### ContainerResizeListener
|
|
1491
|
+
|
|
1492
|
+
容器尺寸变化监听函数。
|
|
1493
|
+
|
|
1494
|
+
#### Type
|
|
1495
|
+
|
|
1496
|
+
`(event: ContainerResizeEvent) => void`
|
|
1497
|
+
|
|
1498
|
+
<a id="containerresizeevent"></a>
|
|
1499
|
+
### ContainerResizeEvent
|
|
1500
|
+
|
|
1501
|
+
容器尺寸变化事件。
|
|
1502
|
+
|
|
1503
|
+
#### Properties
|
|
1504
|
+
|
|
1505
|
+
• **width**: `number` - 变化后的容器宽度,单位为逻辑像素
|
|
1506
|
+
• **height**: `number` - 变化后的容器高度,单位为逻辑像素
|
|
1507
|
+
|
|
1106
1508
|
<a id="windowsafearea"></a>
|
|
1107
1509
|
### WindowSafeArea
|
|
1108
1510
|
|
|
@@ -1299,7 +1701,7 @@ HealthKit 读取权限状态码。 - -1:未知或当前系统不支持该类
|
|
|
1299
1701
|
|
|
1300
1702
|
#### Properties
|
|
1301
1703
|
|
|
1302
|
-
• **appId**: `string` -
|
|
1704
|
+
• **appId**: `string` - 豆包客户端应用标识(AID)
|
|
1303
1705
|
|
|
1304
1706
|
<a id="getappbaseinforesult"></a>
|
|
1305
1707
|
### GetAppBaseInfoResult
|
|
@@ -1307,11 +1709,11 @@ HealthKit 读取权限状态码。 - -1:未知或当前系统不支持该类
|
|
|
1307
1709
|
#### Properties
|
|
1308
1710
|
|
|
1309
1711
|
• **SDKVersion?**: `string` - 客户端基础库版本
|
|
1310
|
-
• **enableDebug?**: `boolean` -
|
|
1712
|
+
• **enableDebug?**: `boolean` - 豆包客户端是否为调试构建
|
|
1311
1713
|
• **host?**: `AppBaseInfoHost` - 当前豆包客户端信息
|
|
1312
|
-
• **language**: `string` -
|
|
1714
|
+
• **language**: `string` - 豆包客户端当前使用的语言
|
|
1313
1715
|
• **version?**: `string` - 豆包客户端版本号
|
|
1314
|
-
• **theme?**: `'light' | 'dark'` -
|
|
1716
|
+
• **theme?**: `'light' | 'dark'` - 当前应用插件使用的主题
|
|
1315
1717
|
|
|
1316
1718
|
<a id="apptheme"></a>
|
|
1317
1719
|
### AppTheme
|
|
@@ -1363,14 +1765,37 @@ HealthKit 读取权限状态码。 - -1:未知或当前系统不支持该类
|
|
|
1363
1765
|
• **windowWidth**: `number` - 可使用窗口宽度,单位为逻辑像素
|
|
1364
1766
|
• **windowHeight**: `number` - 可使用窗口高度,单位为逻辑像素
|
|
1365
1767
|
• **statusBarHeight**: `number` - 状态栏高度,单位为逻辑像素
|
|
1366
|
-
• **language**: `string` -
|
|
1768
|
+
• **language**: `string` - 豆包客户端当前使用的语言
|
|
1367
1769
|
• **version?**: `string` - 豆包客户端版本号
|
|
1368
1770
|
• **system**: `string` - 操作系统及版本,如 "Android 14"、"iOS 17.5"
|
|
1369
1771
|
• **platform**: `string` - 客户端平台,取值为 "ios" 或 "android"
|
|
1370
1772
|
• **SDKVersion?**: `string` - 客户端基础库版本
|
|
1371
|
-
• **theme?**: `'light' | 'dark'` -
|
|
1773
|
+
• **theme?**: `'light' | 'dark'` - 当前应用插件使用的主题
|
|
1372
1774
|
• **benchmarkLevel?**: `number` - 设备性能等级,-1 表示未知
|
|
1373
1775
|
• **safeArea?**: `SystemInfoSafeArea` - 在竖屏正方向下的安全区域,单位为逻辑像素
|
|
1374
|
-
• **enableDebug?**: `boolean` -
|
|
1776
|
+
• **enableDebug?**: `boolean` - 豆包客户端是否为调试构建
|
|
1375
1777
|
• **deviceOrientation?**: `'portrait' | 'landscape'` - 设备方向
|
|
1376
1778
|
• **abi?**: `string` - 豆包客户端二进制接口类型(如 arm64-v8a),仅 Android 返回
|
|
1779
|
+
|
|
1780
|
+
<a id="windowresizelistener"></a>
|
|
1781
|
+
### WindowResizeListener
|
|
1782
|
+
|
|
1783
|
+
窗口尺寸变化监听函数。
|
|
1784
|
+
|
|
1785
|
+
#### Type
|
|
1786
|
+
|
|
1787
|
+
`(event: WindowResizeEvent) => void`
|
|
1788
|
+
|
|
1789
|
+
<a id="windowresizeevent"></a>
|
|
1790
|
+
### WindowResizeEvent
|
|
1791
|
+
|
|
1792
|
+
窗口尺寸变化事件。
|
|
1793
|
+
|
|
1794
|
+
#### Properties
|
|
1795
|
+
|
|
1796
|
+
• **size**: `{
|
|
1797
|
+
/** 窗口宽度。 */
|
|
1798
|
+
windowWidth: number;
|
|
1799
|
+
/** 窗口高度。 */
|
|
1800
|
+
windowHeight: number;
|
|
1801
|
+
}` - 变化后的窗口尺寸,单位为逻辑像素
|