@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.
Files changed (107) hide show
  1. package/README.md +10 -2
  2. package/dist/147.js +9 -0
  3. package/dist/assets.d.ts +5 -0
  4. package/dist/assets.js +4 -0
  5. package/dist/index.d.ts +43 -0
  6. package/dist/index.js +1378 -0
  7. package/dist/plugin.d.ts +102 -0
  8. package/dist/plugin.js +4995 -0
  9. package/dist/preview.js +16 -0
  10. package/dist/rslib-runtime.js +33 -0
  11. package/dist/skills/doubao-plugin-app/SKILL.md +21 -0
  12. package/dist/skills/doubao-plugin-app/references/app-development.md +85 -0
  13. package/dist/skills/doubao-plugin-app/references/frontend/components/container-overlay.md +131 -0
  14. package/dist/skills/doubao-plugin-app/references/frontend/components/form-controls.md +146 -0
  15. package/dist/skills/doubao-plugin-app/references/frontend/components/interactive-controls.md +120 -0
  16. package/dist/skills/doubao-plugin-app/references/frontend/components/map-canvas.md +107 -0
  17. package/dist/skills/doubao-plugin-app/references/frontend/components/overview.md +43 -0
  18. package/dist/skills/doubao-plugin-app/references/frontend/components/scroll-list.md +149 -0
  19. package/dist/skills/doubao-plugin-app/references/frontend/components/text-media.md +209 -0
  20. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/01-/345/237/272/347/241/200.md +1389 -0
  21. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/02-/347/263/273/347/273/237.md +1376 -0
  22. 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
  23. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/04-/345/256/232/344/275/215.md +784 -0
  24. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/05-/345/255/230/345/202/250.md +1176 -0
  25. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/06-/350/267/257/347/224/261.md +839 -0
  26. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/07-/347/225/214/351/235/242.md +376 -0
  27. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/08-/344/272/244/344/272/222.md +1319 -0
  28. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/09-/350/276/223/345/205/245.md +192 -0
  29. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/10-/347/275/221/347/273/234.md +900 -0
  30. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/11-/345/252/222/344/275/223.md +1496 -0
  31. 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
  32. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/13-/347/231/273/345/275/225.md +511 -0
  33. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/14-/346/224/257/344/273/230.md +943 -0
  34. 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
  35. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/16-/350/223/235/347/211/231.md +3364 -0
  36. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/17-wi-fi.md +1028 -0
  37. 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
  38. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/19-ibeacon.md +508 -0
  39. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/20-/347/275/227/347/233/230.md +320 -0
  40. 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
  41. 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
  42. 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
  43. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/24-/347/237/255/344/277/241.md +155 -0
  44. 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
  45. 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
  46. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/27-/347/224/265/346/261/240.md +235 -0
  47. 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
  48. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/29-/345/212/240/345/257/206.md +126 -0
  49. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/30-/346/227/245/345/216/206.md +417 -0
  50. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/31-/347/224/265/350/257/235.md +144 -0
  51. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/32-/346/211/253/347/240/201.md +236 -0
  52. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/33-/345/261/217/345/271/225.md +747 -0
  53. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/34-/351/234/207/345/212/250.md +277 -0
  54. 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
  55. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/common-errors.md +69 -0
  56. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/groups.md +43 -0
  57. package/dist/skills/doubao-plugin-app/references/frontend/doubao-agentic-service-api/quick-reference.md +436 -0
  58. package/dist/skills/doubao-plugin-app/references/frontend/examples/common-patterns.md +590 -0
  59. package/dist/skills/doubao-plugin-app/references/frontend/examples/doubao-agentic-service-api-recipes.md +209 -0
  60. package/dist/skills/doubao-plugin-app/references/frontend/examples/page-widget-basics.md +368 -0
  61. package/dist/skills/doubao-plugin-app/references/frontend/examples/page-widget-recipes.md +65 -0
  62. package/dist/skills/doubao-plugin-app/references/frontend/framework/core.md +283 -0
  63. package/dist/skills/doubao-plugin-app/references/frontend/guides/auth.md +277 -0
  64. package/dist/skills/doubao-plugin-app/references/frontend/guides/best-practices.md +574 -0
  65. package/dist/skills/doubao-plugin-app/references/frontend/guides/client-tools-and-events.md +209 -0
  66. package/dist/skills/doubao-plugin-app/references/frontend/guides/component-development.md +832 -0
  67. package/dist/skills/doubao-plugin-app/references/frontend/guides/debugger-mcp.md +537 -0
  68. package/dist/skills/doubao-plugin-app/references/frontend/guides/expired-widget.md +101 -0
  69. package/dist/skills/doubao-plugin-app/references/frontend/guides/performance-optimization.md +417 -0
  70. package/dist/skills/doubao-plugin-app/references/frontend/guides/troubleshooting.md +278 -0
  71. package/dist/skills/doubao-plugin-app/references/frontend/lynx/best-practices.md +720 -0
  72. package/dist/skills/doubao-plugin-app/references/frontend/lynx/css/pseudo-classes.md +149 -0
  73. package/dist/skills/doubao-plugin-app/references/frontend/lynx/css/selectors.md +224 -0
  74. package/dist/skills/doubao-plugin-app/references/frontend/lynx/css/supported-properties.md +269 -0
  75. package/dist/skills/doubao-plugin-app/references/frontend/lynx/css/values-and-units.md +314 -0
  76. package/dist/skills/doubao-plugin-app/references/frontend/lynx/layout/flex-layout.md +334 -0
  77. package/dist/skills/doubao-plugin-app/references/frontend/lynx/layout/grid-layout.md +408 -0
  78. package/dist/skills/doubao-plugin-app/references/frontend/lynx/layout/linear-layout.md +355 -0
  79. package/dist/skills/doubao-plugin-app/references/frontend/lynx/layout/relative-layout.md +189 -0
  80. package/dist/skills/doubao-plugin-app/references/frontend/lynx/lynx-vs-web/css-differences.md +737 -0
  81. package/dist/skills/doubao-plugin-app/references/frontend/lynx/lynx-vs-web/migration-guide.md +669 -0
  82. package/dist/skills/doubao-plugin-app/references/frontend/lynx/lynx-vs-web/unsupported-features.md +290 -0
  83. package/dist/skills/doubao-plugin-app/references/frontend/lynx/overview.md +60 -0
  84. package/dist/skills/doubao-plugin-app/references/frontend/lynx/patterns/animation.md +243 -0
  85. package/dist/skills/doubao-plugin-app/references/frontend/lynx/patterns/responsive.md +194 -0
  86. package/dist/skills/doubao-plugin-app/references/frontend/lynx/patterns/theming.md +143 -0
  87. package/dist/skills/doubao-plugin-app/references/frontend/lynx/quick-reference.md +229 -0
  88. package/dist/skills/doubao-plugin-app/references/frontend/rules/dos-and-donts.md +479 -0
  89. package/dist/skills/doubao-plugin-app/references/frontend/widget-templates/design-boundary.md +46 -0
  90. package/dist/skills/doubao-plugin-app/references/frontend/widget-templates/overview.md +118 -0
  91. package/dist/skills/doubao-plugin-app/references/frontend/widget-templates/props.md +301 -0
  92. package/dist/skills/doubao-plugin-app/references/mcp-and-cards.md +38 -0
  93. package/dist/templates/README.md.template +11 -0
  94. package/dist/templates/com.doubao/app/manifest.yaml +41 -0
  95. package/dist/templates/com.doubao/app/package.json.template +13 -0
  96. package/dist/templates/com.doubao/app/src/app.config.ts.template +5 -0
  97. package/dist/templates/com.doubao/app/src/app.ts.template +3 -0
  98. package/dist/templates/com.doubao/app/src/pages/home/index.css +14 -0
  99. package/dist/templates/com.doubao/app/src/pages/home/index.tsx.template +14 -0
  100. package/dist/templates/com.doubao/app/src/widgets/example/index.tsx.template +29 -0
  101. package/dist/templates/com.doubao/app/tsconfig.json +19 -0
  102. package/dist/templates/mcp.json +9 -0
  103. package/dist/templates/plugin.json.template +29 -0
  104. package/dist/templates/skills/example/SKILL.md.template +14 -0
  105. package/dist/upload.d.ts +44 -0
  106. package/dist/upload.js +38 -0
  107. package/package.json +60 -3
@@ -0,0 +1,747 @@
1
+ # 豆包应用插件的端能力 API: 屏幕
2
+
3
+ 屏幕亮度、常亮和截屏/录屏相关能力。
4
+
5
+ [返回目录](./groups.md) | [返回速查](./quick-reference.md)
6
+
7
+ ## 速查
8
+
9
+ | API | 说明 |
10
+ | --- | --- |
11
+ | [getScreenBrightness](#getscreenbrightness) | 获取屏幕亮度。 |
12
+ | [setScreenBrightness](#setscreenbrightness) | 设置屏幕亮度。 |
13
+ | [setKeepScreenOn](#setkeepscreenon) | 设置屏幕常亮状态。 |
14
+ | [disableUserScreenRecord](#disableuserscreenrecord) | 禁止用户录屏。 |
15
+ | [enableUserScreenRecord](#enableuserscreenrecord) | 允许用户录屏。 |
16
+ | [onUserCaptureScreen](#onusercapturescreen) | 监听用户主动截屏事件。<br><br>返回取消监听函数。 |
17
+ | [onUserScreenRecord](#onuserscreenrecord) | 监听用户录屏事件。<br><br>返回取消监听函数。 |
18
+
19
+ ## API 详情
20
+
21
+ <a id="getscreenbrightness"></a>
22
+ ### getScreenBrightness()
23
+
24
+ # getScreenBrightness
25
+
26
+ 获取屏幕亮度。
27
+
28
+ ## 扫码预览
29
+ ![扫码预览 getScreenBrightness](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fapi%252Fdevice%252Fget-screen-brightness%252Findex)
30
+
31
+ ## 支持版本
32
+
33
+ 前端库版本不低于 `0.0.19`。
34
+
35
+ ## 支持平台
36
+
37
+ <table>
38
+ <thead>
39
+ <tr><th>平台</th><th>支持情况</th></tr>
40
+ </thead>
41
+ <tbody>
42
+ <tr><td>Android</td><td>支持</td></tr>
43
+ <tr><td>iOS</td><td>支持</td></tr>
44
+ <tr><td>PC</td><td>不支持</td></tr>
45
+ <tr><td>HarmonyOS</td><td>不支持</td></tr>
46
+ </tbody>
47
+ </table>
48
+
49
+ ## 支持场景
50
+
51
+ <table>
52
+ <thead>
53
+ <tr><th>场景</th><th>支持情况</th></tr>
54
+ </thead>
55
+ <tbody>
56
+ <tr><td>页面</td><td>支持</td></tr>
57
+ <tr><td>卡片</td><td>不支持</td></tr>
58
+ </tbody>
59
+ </table>
60
+
61
+ ## 使用说明
62
+
63
+ - 返回值为归一化后的 0 到 1 亮度
64
+
65
+ ## 调用方式
66
+
67
+ ### 异步 API
68
+
69
+ ```typescript
70
+ getScreenBrightness(params?: object): Promise<GetScreenBrightnessResult>
71
+ ```
72
+
73
+ ## 入参
74
+
75
+ 无。
76
+
77
+ ## 调用示例
78
+
79
+ ```typescript
80
+ import { getScreenBrightness } from '@doubao-dev/framework/api';
81
+
82
+ const { value } = await getScreenBrightness();
83
+
84
+ console.log(value);
85
+ ```
86
+
87
+ ## 成功返回
88
+
89
+ <table>
90
+ <thead>
91
+ <tr><th>名称</th><th>类型</th><th>必返</th><th>约束</th><th>说明</th></tr>
92
+ </thead>
93
+ <tbody>
94
+ <tr><td><code>value</code></td><td><code>number</code></td><td>是</td><td>取值范围 0 到 1,0 最暗,1 最亮</td><td>屏幕亮度值。</td></tr>
95
+ </tbody>
96
+ </table>
97
+
98
+ ### 返回示例
99
+
100
+ ```json
101
+ {
102
+ "value": 0.6
103
+ }
104
+ ```
105
+
106
+ ## 错误处理
107
+
108
+ 错误对象和通用错误码见 [通用错误处理](./common-errors.md#错误返回)。
109
+
110
+ ### 错误码
111
+
112
+ #### 通用错误码
113
+
114
+ <table>
115
+ <thead>
116
+ <tr><th>errNo</th><th>errMsg</th><th>说明</th><th>平台</th></tr>
117
+ </thead>
118
+ <tbody>
119
+ <tr><td><code>102</code></td><td><code>internal error</code></td><td>内部错误</td><td>Android、iOS</td></tr>
120
+ </tbody>
121
+ </table>
122
+
123
+ <a id="setscreenbrightness"></a>
124
+ ### setScreenBrightness()
125
+
126
+ # setScreenBrightness
127
+
128
+ 设置屏幕亮度。
129
+
130
+ ## 扫码预览
131
+ ![扫码预览 setScreenBrightness](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fapi%252Fdevice%252Fget-screen-brightness%252Findex)
132
+
133
+ ## 支持版本
134
+
135
+ 前端库版本不低于 `0.4.0`。
136
+
137
+ ## 支持平台
138
+
139
+ <table>
140
+ <thead>
141
+ <tr><th>平台</th><th>支持情况</th></tr>
142
+ </thead>
143
+ <tbody>
144
+ <tr><td>Android</td><td>支持</td></tr>
145
+ <tr><td>iOS</td><td>支持</td></tr>
146
+ <tr><td>PC</td><td>不支持</td></tr>
147
+ <tr><td>HarmonyOS</td><td>不支持</td></tr>
148
+ </tbody>
149
+ </table>
150
+
151
+ ## 支持场景
152
+
153
+ <table>
154
+ <thead>
155
+ <tr><th>场景</th><th>支持情况</th></tr>
156
+ </thead>
157
+ <tbody>
158
+ <tr><td>页面</td><td>支持</td></tr>
159
+ <tr><td>卡片</td><td>不支持</td></tr>
160
+ </tbody>
161
+ </table>
162
+
163
+ ## 接入准备
164
+
165
+ ### 前置条件
166
+
167
+ - value 必须是 0 到 1 之间的有限数字
168
+
169
+ ## 使用说明
170
+
171
+ - 该设置仅在当前应用插件生命周期内生效,退出后自动恢复原亮度
172
+
173
+ ## 调用方式
174
+
175
+ ### 异步 API
176
+
177
+ ```typescript
178
+ setScreenBrightness(params: SetScreenBrightnessParams): Promise<object>
179
+ ```
180
+
181
+ ## 入参
182
+
183
+ <table>
184
+ <thead>
185
+ <tr><th>名称</th><th>类型</th><th>必填</th><th>默认值</th><th>约束</th><th>说明</th></tr>
186
+ </thead>
187
+ <tbody>
188
+ <tr><td><code>value</code></td><td><code>number</code></td><td>是</td><td>-</td><td>取值范围 0 到 1,0 最暗,1 最亮</td><td>屏幕亮度值。</td></tr>
189
+ </tbody>
190
+ </table>
191
+
192
+ ## 调用示例
193
+
194
+ ```typescript
195
+ import { setScreenBrightness } from '@doubao-dev/framework/api';
196
+
197
+ await setScreenBrightness({ value: 0.8 });
198
+ ```
199
+
200
+ ## 成功返回
201
+
202
+ 无返回字段。
203
+
204
+ ### 返回示例
205
+
206
+ ```json
207
+ {}
208
+ ```
209
+
210
+ ## 错误处理
211
+
212
+ 错误对象和通用错误码见 [通用错误处理](./common-errors.md#错误返回)。
213
+
214
+ ### 错误码
215
+
216
+ #### 通用错误码
217
+
218
+ <table>
219
+ <thead>
220
+ <tr><th>errNo</th><th>errMsg</th><th>说明</th><th>平台</th></tr>
221
+ </thead>
222
+ <tbody>
223
+ <tr><td><code>102</code></td><td><code>internal error</code></td><td>内部错误</td><td>Android、iOS</td></tr>
224
+ <tr><td><code>103</code></td><td><code>feature not support</code></td><td>当前环境不支持该能力</td><td>Android、iOS</td></tr>
225
+ <tr><td><code>104</code></td><td><code>invalid parameter</code></td><td>参数不合法</td><td>Android、iOS</td></tr>
226
+ </tbody>
227
+ </table>
228
+
229
+ ## 平台差异
230
+
231
+ - **Android**:使用当前宿主窗口亮度,不修改系统全局亮度
232
+ - **iOS**:应用插件进入后台时恢复系统亮度,回到前台时重新应用设置值
233
+
234
+ <a id="setkeepscreenon"></a>
235
+ ### setKeepScreenOn()
236
+
237
+ # setKeepScreenOn
238
+
239
+ 设置屏幕常亮状态。
240
+
241
+ ## 扫码预览
242
+ ![扫码预览 setKeepScreenOn](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fapi%252Fdevice%252Fset-keep-screen-on%252Findex)
243
+
244
+ ## 支持版本
245
+
246
+ 前端库版本不低于 `0.0.25`。
247
+
248
+ ## 支持平台
249
+
250
+ <table>
251
+ <thead>
252
+ <tr><th>平台</th><th>支持情况</th></tr>
253
+ </thead>
254
+ <tbody>
255
+ <tr><td>Android</td><td>支持</td></tr>
256
+ <tr><td>iOS</td><td>支持</td></tr>
257
+ <tr><td>PC</td><td>不支持</td></tr>
258
+ <tr><td>HarmonyOS</td><td>不支持</td></tr>
259
+ </tbody>
260
+ </table>
261
+
262
+ ## 支持场景
263
+
264
+ <table>
265
+ <thead>
266
+ <tr><th>场景</th><th>支持情况</th></tr>
267
+ </thead>
268
+ <tbody>
269
+ <tr><td>页面</td><td>支持</td></tr>
270
+ <tr><td>卡片</td><td>不支持</td></tr>
271
+ </tbody>
272
+ </table>
273
+
274
+ ## 使用说明
275
+
276
+ - 不再需要常亮时应主动将 keepScreenOn 设为 false,避免额外功耗
277
+
278
+ ## 调用方式
279
+
280
+ ### 异步 API
281
+
282
+ ```typescript
283
+ setKeepScreenOn(params: SetKeepScreenOnParams): Promise<object>
284
+ ```
285
+
286
+ ## 入参
287
+
288
+ <table>
289
+ <thead>
290
+ <tr><th>名称</th><th>类型</th><th>必填</th><th>默认值</th><th>约束</th><th>说明</th></tr>
291
+ </thead>
292
+ <tbody>
293
+ <tr><td><code>keepScreenOn</code></td><td><code>boolean</code></td><td>是</td><td>-</td><td>-</td><td>是否保持屏幕常亮。</td></tr>
294
+ </tbody>
295
+ </table>
296
+
297
+ ## 调用示例
298
+
299
+ ```typescript
300
+ import { setKeepScreenOn } from '@doubao-dev/framework/api';
301
+
302
+ await setKeepScreenOn({ keepScreenOn: true });
303
+ ```
304
+
305
+ ## 成功返回
306
+
307
+ 无返回字段。
308
+
309
+ ### 返回示例
310
+
311
+ ```json
312
+ {}
313
+ ```
314
+
315
+ ## 错误处理
316
+
317
+ 错误对象和通用错误码见 [通用错误处理](./common-errors.md#错误返回)。
318
+
319
+ ### 错误码
320
+
321
+ #### 通用错误码
322
+
323
+ <table>
324
+ <thead>
325
+ <tr><th>errNo</th><th>errMsg</th><th>说明</th><th>平台</th></tr>
326
+ </thead>
327
+ <tbody>
328
+ <tr><td><code>102</code></td><td><code>internal error</code></td><td>内部错误</td><td>Android</td></tr>
329
+ </tbody>
330
+ </table>
331
+
332
+ ## 平台差异
333
+
334
+ - **iOS**:页面销毁后常亮状态会自动恢复
335
+ - **iOS**:设置常亮恒返回成功,无失败错误码
336
+
337
+ <a id="disableuserscreenrecord"></a>
338
+ ### disableUserScreenRecord()
339
+
340
+ # disableUserScreenRecord
341
+
342
+ 禁止用户录屏。
343
+
344
+ ## 支持版本
345
+
346
+ 前端库版本不低于 `0.0.37`。
347
+
348
+ ## 支持平台
349
+
350
+ <table>
351
+ <thead>
352
+ <tr><th>平台</th><th>支持情况</th></tr>
353
+ </thead>
354
+ <tbody>
355
+ <tr><td>Android</td><td>支持</td></tr>
356
+ <tr><td>iOS</td><td>支持</td></tr>
357
+ <tr><td>PC</td><td>不支持</td></tr>
358
+ <tr><td>HarmonyOS</td><td>不支持</td></tr>
359
+ </tbody>
360
+ </table>
361
+
362
+ ## 支持场景
363
+
364
+ <table>
365
+ <thead>
366
+ <tr><th>场景</th><th>支持情况</th></tr>
367
+ </thead>
368
+ <tbody>
369
+ <tr><td>页面</td><td>支持</td></tr>
370
+ <tr><td>卡片</td><td>不支持</td></tr>
371
+ </tbody>
372
+ </table>
373
+
374
+ ## 使用说明
375
+
376
+ - 需要恢复录屏能力时调用 `enableUserScreenRecord`
377
+
378
+ ## 调用方式
379
+
380
+ ### 异步 API
381
+
382
+ ```typescript
383
+ disableUserScreenRecord(params?: object): Promise<object>
384
+ ```
385
+
386
+ ## 入参
387
+
388
+ 无。
389
+
390
+ ## 调用示例
391
+
392
+ ```typescript
393
+ import { disableUserScreenRecord } from '@doubao-dev/framework/api';
394
+
395
+ await disableUserScreenRecord();
396
+ ```
397
+
398
+ ## 成功返回
399
+
400
+ 无返回字段。
401
+
402
+ ### 返回示例
403
+
404
+ ```json
405
+ {}
406
+ ```
407
+
408
+ ## 错误处理
409
+
410
+ 错误对象和通用错误码见 [通用错误处理](./common-errors.md#错误返回)。
411
+
412
+ ### 错误码
413
+
414
+ #### 通用错误码
415
+
416
+ <table>
417
+ <thead>
418
+ <tr><th>errNo</th><th>errMsg</th><th>说明</th><th>平台</th></tr>
419
+ </thead>
420
+ <tbody>
421
+ <tr><td><code>102</code></td><td><code>internal error</code></td><td>内部错误</td><td>Android、iOS</td></tr>
422
+ </tbody>
423
+ </table>
424
+
425
+ ## 平台差异
426
+
427
+ - **Android**:对整个窗口生效,会同时影响截屏
428
+ - **iOS**:仅对内容视图生效
429
+
430
+ <a id="enableuserscreenrecord"></a>
431
+ ### enableUserScreenRecord()
432
+
433
+ # enableUserScreenRecord
434
+
435
+ 允许用户录屏。
436
+
437
+ ## 支持版本
438
+
439
+ 前端库版本不低于 `0.0.37`。
440
+
441
+ ## 支持平台
442
+
443
+ <table>
444
+ <thead>
445
+ <tr><th>平台</th><th>支持情况</th></tr>
446
+ </thead>
447
+ <tbody>
448
+ <tr><td>Android</td><td>支持</td></tr>
449
+ <tr><td>iOS</td><td>支持</td></tr>
450
+ <tr><td>PC</td><td>不支持</td></tr>
451
+ <tr><td>HarmonyOS</td><td>不支持</td></tr>
452
+ </tbody>
453
+ </table>
454
+
455
+ ## 支持场景
456
+
457
+ <table>
458
+ <thead>
459
+ <tr><th>场景</th><th>支持情况</th></tr>
460
+ </thead>
461
+ <tbody>
462
+ <tr><td>页面</td><td>支持</td></tr>
463
+ <tr><td>卡片</td><td>不支持</td></tr>
464
+ </tbody>
465
+ </table>
466
+
467
+ ## 使用说明
468
+
469
+ - 与 `disableUserScreenRecord` 配对使用
470
+
471
+ ## 调用方式
472
+
473
+ ### 异步 API
474
+
475
+ ```typescript
476
+ enableUserScreenRecord(params?: object): Promise<object>
477
+ ```
478
+
479
+ ## 入参
480
+
481
+ 无。
482
+
483
+ ## 调用示例
484
+
485
+ ```typescript
486
+ import { enableUserScreenRecord } from '@doubao-dev/framework/api';
487
+
488
+ await enableUserScreenRecord();
489
+ ```
490
+
491
+ ## 成功返回
492
+
493
+ 无返回字段。
494
+
495
+ ### 返回示例
496
+
497
+ ```json
498
+ {}
499
+ ```
500
+
501
+ ## 错误处理
502
+
503
+ 错误对象和通用错误码见 [通用错误处理](./common-errors.md#错误返回)。
504
+
505
+ ### 错误码
506
+
507
+ #### 通用错误码
508
+
509
+ <table>
510
+ <thead>
511
+ <tr><th>errNo</th><th>errMsg</th><th>说明</th><th>平台</th></tr>
512
+ </thead>
513
+ <tbody>
514
+ <tr><td><code>102</code></td><td><code>internal error</code></td><td>内部错误</td><td>Android、iOS</td></tr>
515
+ </tbody>
516
+ </table>
517
+
518
+ <a id="onusercapturescreen"></a>
519
+ ### onUserCaptureScreen()
520
+
521
+ # onUserCaptureScreen
522
+
523
+ 监听用户主动截屏事件。
524
+
525
+ ## 扫码预览
526
+ ![扫码预览 onUserCaptureScreen](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fapi%252Fdevice%252Fon-user-capture-screen%252Findex)
527
+
528
+ ## 支持版本
529
+
530
+ 前端库版本不低于 `0.0.26`。
531
+
532
+ ## 支持平台
533
+
534
+ <table>
535
+ <thead>
536
+ <tr><th>平台</th><th>支持情况</th></tr>
537
+ </thead>
538
+ <tbody>
539
+ <tr><td>Android</td><td>支持</td></tr>
540
+ <tr><td>iOS</td><td>支持</td></tr>
541
+ <tr><td>PC</td><td>不支持</td></tr>
542
+ <tr><td>HarmonyOS</td><td>不支持</td></tr>
543
+ </tbody>
544
+ </table>
545
+
546
+ ## 支持场景
547
+
548
+ <table>
549
+ <thead>
550
+ <tr><th>场景</th><th>支持情况</th></tr>
551
+ </thead>
552
+ <tbody>
553
+ <tr><td>页面</td><td>支持</td></tr>
554
+ <tr><td>卡片</td><td>不支持</td></tr>
555
+ </tbody>
556
+ </table>
557
+
558
+ ## 使用说明
559
+
560
+ - 事件不携带截图内容,仅通知发生了截屏
561
+
562
+ ## 调用方式
563
+
564
+ ### 事件监听 API
565
+
566
+ ```typescript
567
+ onUserCaptureScreen(callback: (event: UserCaptureScreenEvent) => void): () => void
568
+ ```
569
+
570
+ ## 入参
571
+
572
+ 无。
573
+
574
+ ## 调用示例
575
+
576
+ ```ts
577
+ import { onUserCaptureScreen } from '@doubao-dev/framework/api';
578
+
579
+ const off = onUserCaptureScreen(() => {
580
+ console.log('用户截屏了');
581
+ });
582
+
583
+ off();
584
+ ```
585
+
586
+ ## 回调参数
587
+
588
+ 无。
589
+
590
+ ## 返回值
591
+
592
+ 无返回字段。
593
+
594
+ ### 回调示例
595
+
596
+ ```json
597
+ {}
598
+ ```
599
+
600
+ <a id="onuserscreenrecord"></a>
601
+ ### onUserScreenRecord()
602
+
603
+ # onUserScreenRecord
604
+
605
+ 监听用户录屏事件。
606
+
607
+ ## 扫码预览
608
+ ![扫码预览 onUserScreenRecord](https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fapi%252Fdevice%252Fon-user-screen-record%252Findex)
609
+
610
+ ## 支持版本
611
+
612
+ 前端库版本不低于 `0.0.37`。
613
+
614
+ ## 支持平台
615
+
616
+ <table>
617
+ <thead>
618
+ <tr><th>平台</th><th>支持情况</th></tr>
619
+ </thead>
620
+ <tbody>
621
+ <tr><td>Android</td><td>支持</td></tr>
622
+ <tr><td>iOS</td><td>支持</td></tr>
623
+ <tr><td>PC</td><td>不支持</td></tr>
624
+ <tr><td>HarmonyOS</td><td>不支持</td></tr>
625
+ </tbody>
626
+ </table>
627
+
628
+ ## 支持场景
629
+
630
+ <table>
631
+ <thead>
632
+ <tr><th>场景</th><th>支持情况</th></tr>
633
+ </thead>
634
+ <tbody>
635
+ <tr><td>页面</td><td>支持</td></tr>
636
+ <tr><td>卡片</td><td>不支持</td></tr>
637
+ </tbody>
638
+ </table>
639
+
640
+ ## 使用说明
641
+
642
+ - iOS 订阅成功后会立即回报一次当前录屏状态
643
+
644
+ ## 调用方式
645
+
646
+ ### 事件监听 API
647
+
648
+ ```typescript
649
+ onUserScreenRecord(callback: (event: UserScreenRecordEvent) => void): () => void
650
+ ```
651
+
652
+ ## 入参
653
+
654
+ 无。
655
+
656
+ ## 调用示例
657
+
658
+ ```ts
659
+ import { onUserScreenRecord } from '@doubao-dev/framework/api';
660
+
661
+ const off = onUserScreenRecord(({ state }) => {
662
+ console.log(state);
663
+ });
664
+
665
+ off();
666
+ ```
667
+
668
+ ## 回调参数
669
+
670
+ <table>
671
+ <thead>
672
+ <tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
673
+ </thead>
674
+ <tbody>
675
+ <tr><td><code>event.state</code></td><td><code>UserScreenRecordState</code></td><td>是</td><td>录屏状态,start 表示开始录屏,stop 表示停止录屏。</td></tr>
676
+ </tbody>
677
+ </table>
678
+
679
+ ## 返回值
680
+
681
+ 返回取消当前监听函数的函数。
682
+
683
+ ### 回调示例
684
+
685
+ ```json
686
+ {
687
+ "state": "start"
688
+ }
689
+ ```
690
+
691
+ ## 平台差异
692
+
693
+ - **Android**:仅 Android 15 及以上上报录屏事件,低版本不生效
694
+
695
+ ## 相关类型
696
+
697
+ <a id="getscreenbrightnessresult"></a>
698
+ ### GetScreenBrightnessResult
699
+
700
+ #### Properties
701
+
702
+ • **value**: `number` - 屏幕亮度值
703
+
704
+ <a id="setscreenbrightnessparams"></a>
705
+ ### SetScreenBrightnessParams
706
+
707
+ 设置屏幕亮度的请求参数。
708
+
709
+ #### Properties
710
+
711
+ • **value**: `number` - 屏幕亮度值
712
+
713
+ <a id="setkeepscreenonparams"></a>
714
+ ### SetKeepScreenOnParams
715
+
716
+ 设置屏幕常亮的请求参数。
717
+
718
+ #### Properties
719
+
720
+ • **keepScreenOn**: `boolean` - 是否保持屏幕常亮
721
+
722
+ <a id="usercapturescreenevent"></a>
723
+ ### UserCaptureScreenEvent
724
+
725
+ 用户主动截屏事件。
726
+
727
+ #### Properties
728
+
729
+ 无字段。
730
+
731
+ <a id="userscreenrecordstate"></a>
732
+ ### UserScreenRecordState
733
+
734
+ 用户录屏状态。
735
+
736
+ #### Type
737
+
738
+ `'start' | 'stop'`
739
+
740
+ <a id="userscreenrecordevent"></a>
741
+ ### UserScreenRecordEvent
742
+
743
+ 用户录屏事件。
744
+
745
+ #### Properties
746
+
747
+ • **state**: `UserScreenRecordState` - 录屏状态,start 表示开始录屏,stop 表示停止录屏