@doubao-dev/framework 0.0.40 → 0.0.42-canary-d679ede7d-20260902030825

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/api.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { HealthDataType as HealthDataType_2 } from '@byted-doubao-apps/bridge-api';
2
+
1
3
  /**
2
4
  * 加速度数据变化事件。
3
5
  *
@@ -67,6 +69,8 @@ export declare enum ActionDirectiveType {
67
69
  *
68
70
  * @since 0.0.19
69
71
  * @contractStatus verified | Android、iOS 均支持向系统日历写入一次性事件;成功通过 Promise resolve 空对象,失败通过 Promise reject。
72
+ * @containerSupport Page | supported
73
+ * @containerSupport Widget | supported
70
74
  * @platformSupport Android | supported | 写入系统日历事件;path 传入后按原值追加到日历备注。
71
75
  * @platformSupport iOS | supported | 写入系统日历事件;path 传入后按原值追加到日历备注。
72
76
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -155,6 +159,8 @@ export declare interface AddPhoneCalendarParams {
155
159
  *
156
160
  * @since 0.0.25
157
161
  * @contractStatus verified | Android、iOS 均支持向系统日历写入重复事件;成功通过 Promise resolve 空对象,失败通过 Promise reject。
162
+ * @containerSupport Page | supported
163
+ * @containerSupport Widget | supported
158
164
  * @platformSupport Android | supported | 写入系统日历重复事件;repeatInterval 支持 day、week、month、year,path 行为与 addPhoneCalendar 一致。
159
165
  * @platformSupport iOS | supported | 写入系统日历重复事件;repeatInterval 支持 day、week、month、year,path 行为与 addPhoneCalendar 一致。
160
166
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -191,12 +197,23 @@ export declare interface AddPhoneRepeatCalendarParams extends AddPhoneCalendarPa
191
197
  repeatEndTime?: number;
192
198
  }
193
199
 
200
+ /**
201
+ * 相册精细授权状态。
202
+ *
203
+ * 继承 {@link BasicAuthorizationDetail} 的全部取值,并增加:
204
+ * - `limited`:只能访问用户选择的部分照片;支持 iOS 和 Android 14 及以上版本。
205
+ * - `add only`:只能向相册添加照片,不能读取相册内容;仅 iOS 支持。
206
+ *
207
+ * @public
208
+ */
209
+ export declare type AlbumAuthorizationDetail = BasicAuthorizationDetail | 'limited' | 'add only';
210
+
194
211
  /** @public */
195
212
  export declare type AppAuthorizeStatus = 'authorized' | 'denied' | 'not determined';
196
213
 
197
214
  /** @public */
198
215
  export declare interface AppBaseInfoHost {
199
- /** 宿主 app 对应的 appId */
216
+ /** 当前豆包客户端的 appId */
200
217
  appId: string;
201
218
  }
202
219
 
@@ -237,7 +254,7 @@ export declare interface AppendFileParams {
237
254
  export declare type AppTheme = 'light' | 'dark';
238
255
 
239
256
  /**
240
- * 提前向用户发起指定 scope 的应用授权。
257
+ * 提前向用户发起指定 scope 的授权;scope.healthData 仅用于选择 iOS HealthKit 系统授权路径。
241
258
  *
242
259
  * @param params - 授权参数,字段见 {@link AuthorizeRequest}。
243
260
  * @returns 返回一个 Promise,用户完成授权后 resolve。
@@ -246,20 +263,50 @@ export declare type AppTheme = 'light' | 'dark';
246
263
  * import { authorize } from '@doubao-dev/framework/api';
247
264
  *
248
265
  * await authorize({ scope: 'scope.userLocation' });
266
+ * await authorize({
267
+ * scope: 'scope.healthData',
268
+ * options: { types: ['heart_rate', 'step_count'] }
269
+ * });
249
270
  * ```
250
271
  *
251
272
  * @since 0.0.18
252
273
  * @contractStatus conflict | scope 公开声明了 scope.payment,但 Android、iOS 当前不支持该 scope。
253
274
  * @contractMismatch blocking | parameter | scope | Android,iOS | scope 可取 scope.payment | 传入 scope.payment 时被判为非法 scope 并直接失败 | 依赖 scope.payment 发起授权的调用无法成功 | packages/open-api/src/basic/authorize.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/authorize/AuthorizeFlowMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Auth/AIBridgeAuthorizeMethod.swift | 补齐豆包支付授权 scope,或从公开 scope 中移除 scope.payment
254
- * @platformSupport Android | supported | 支持按 scope 发起应用授权。
255
- * @platformSupport iOS | supported | 支持按 scope 发起应用授权。
275
+ * @containerSupport Page | supported
276
+ * @containerSupport Widget | unsupported
277
+ * @platformSupport Android | supported | 支持既有 scope;当前不支持 scope.healthData。
278
+ * @platformSupport iOS | supported | 支持既有 scope;scope.healthData 会继续申请 options.types 对应的 HealthKit 读取权限。
256
279
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
257
280
  * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
258
- * @permission applet | 传入的 scope | required | Android,iOS | 按传入 scope 发起对应的应用授权。
259
- * @authorizationBehavior All | 调用会主动向用户发起指定 scope 的授权弹窗。用户拒绝、取消或此前已撤销授权时调用直接失败,可再次调用 `authorize` 重新发起;scope 未在应用权限声明中配置或不受支持时也会失败。
260
- * @precondition All | 在应用权限声明中配置需要申请的 scope。
261
- * @usageNote All | 授权状态可通过 `getSetting` 查询;建议在真正需要能力前再发起授权。
262
- * @errorCode none | - | - | Android,iOS | 用户拒绝、取消或 scope 非法等失败当前只返回文本信息,未稳定返回顶层 errNo/errMsg | 根据异常信息提示用户重新授权或检查 scope 声明
281
+ * @permission applet | 非 scope.healthData 的 scope | required | Android,iOS | 按传入 scope 发起对应的应用授权。
282
+ * @permission applet | scope.healthData | none | iOS | 不校验 manifest,也不查询或更新服务端小程序 scope 状态。
283
+ * @permission system | HealthKit read | required | iOS | scope.healthData 会申请 options.types 对应的系统读取权限。
284
+ * @authorizationBehavior Android | 非健康 scope 会发起小程序及相应系统授权;当前不支持 scope.healthData。
285
+ * @authorizationBehavior iOS | 非健康 scope 会发起小程序及相应系统授权;scope.healthData 仅可能展示 HealthKit 系统授权框。
286
+ * @precondition Android | 非健康 scope 需要在应用权限声明中配置;当前不支持 scope.healthData。
287
+ * @precondition iOS | 非健康 scope 需要在应用权限声明中配置;scope.healthData 不需要 manifest 声明。
288
+ * @usageNote Android | 非健康 scope 的授权状态可通过 `getSetting` 查询;当前不支持 scope.healthData。
289
+ * @usageNote iOS | 非健康 scope 的授权状态可通过 `getSetting` 查询;scope.healthData 的逐类型系统状态通过 `getAppAuthorizeSetting` 查询。
290
+ * @usageNote iOS | HealthKit 授权成功表示系统授权流程已完成;Apple 不向应用公开每个读取类型是否被用户拒绝。
291
+ * @errorExample
292
+ * ```json
293
+ * {
294
+ * "errNo": 107,
295
+ * "errMsg": "user permission denied"
296
+ * }
297
+ * ```
298
+ * @errorCode common | 102 | Android,iOS
299
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | 传入的 scope 为空或不受支持(如 scope.payment) | 检查并传入受支持的 scope 后重试。
300
+ * @errorCode errNo | 104 | invalid parameter | iOS | scope.healthData 未传 options.types、列表为空或包含不支持类型 | 传入非空且受支持的健康数据类型列表。
301
+ * @errorCode errNo | 106 | system permission denied | Android,iOS | 对应能力的系统权限被拒绝 | 引导用户在系统设置中开启对应权限后重试。
302
+ * @errorCode errNo | 107 | user permission denied | Android,iOS | 用户拒绝了本次应用授权 | 说明能力用途后再次调用 `authorize` 重新发起授权。
303
+ * @errorCode errNo | 114 | operation cancelled | Android,iOS | 用户取消了授权弹窗 | 用户需要时可再次调用 `authorize` 重新发起授权。
304
+ * @errorCode errNo | 301 | network request cancelled | iOS | 授权过程中的网络请求被取消 | 确认应用和网络状态后重试。
305
+ * @errorCode errNo | 302 | connection timed out | iOS | 授权过程中的网络连接超时 | 检查网络连接后重试。
306
+ * @errorCode errNo | 303 | no network connection | iOS | 当前无可用网络连接 | 恢复网络连接后重试。
307
+ * @errorCode errNo | 305 | network failure | Android,iOS | 授权过程中发生其他网络错误 | 检查网络连接,稍后重试。
308
+ * @errorCode errNo | 112 | invalid result | iOS | 授权服务返回的数据无法解析 | 稍后重试;持续失败时反馈服务端响应异常。
309
+ * @platformNote iOS | 网络类失败会细分为 301/302/303/305,并可能返回 112;Android 的网络类失败统一返回 305。
263
310
  *
264
311
  * @public
265
312
  */
@@ -267,12 +314,13 @@ export declare const authorize: (params: AuthorizeRequest) => Promise<object>;
267
314
 
268
315
  /** @public */
269
316
  export declare interface AuthorizeRequest {
317
+ /** 授权范围。 */
318
+ scope: Scope;
270
319
  /**
271
- * 授权范围
272
- *
273
- * @constraint 豆包 Android、iOS 当前不支持 scope.payment,传入后授权会失败
320
+ * 权限扩展参数;仅 scope.healthData 生效,用于传入 HealthKit 读取类型,其他 scope 会忽略该字段。
321
+ * @default -
274
322
  */
275
- scope: Scope;
323
+ options?: HealthDataAuthorizeOptions;
276
324
  }
277
325
 
278
326
  /** @public */
@@ -424,6 +472,16 @@ export declare interface BackgroundAudioState {
424
472
  playbackRate?: number;
425
473
  }
426
474
 
475
+ /**
476
+ * 只有完整授权和未授权状态的权限所使用的通用精细状态。
477
+ *
478
+ * 继承 {@link UnauthorizedDetail} 的全部取值,并增加:
479
+ * - `full`:已获得该权限的完整访问能力。
480
+ *
481
+ * @public
482
+ */
483
+ export declare type BasicAuthorizationDetail = UnauthorizedDetail | 'full';
484
+
427
485
  /**
428
486
  * 电池信息变化事件。
429
487
  *
@@ -512,6 +570,16 @@ export declare type BluetoothAdapterStateChangeEvent = GetBluetoothAdapterStateR
512
570
  /** @public */
513
571
  export declare type BluetoothAdapterStateChangeListener = (event: BluetoothAdapterStateChangeEvent) => void;
514
572
 
573
+ /**
574
+ * 蓝牙精细授权状态。
575
+ *
576
+ * 继承 {@link BasicAuthorizationDetail} 的全部取值,并增加:
577
+ * - `partial`:只获得部分已声明的蓝牙子权限;仅 Android 支持。
578
+ *
579
+ * @public
580
+ */
581
+ export declare type BluetoothAuthorizationDetail = BasicAuthorizationDetail | 'partial';
582
+
515
583
  /**
516
584
  * 蓝牙广播二进制字段。
517
585
  *
@@ -722,6 +790,156 @@ export declare type BottomSheetCancelSource = 'mask' | 'gesture' | 'hostUnavaila
722
790
  */
723
791
  export declare type CalendarRepeatInterval = 'day' | 'week' | 'month' | 'year';
724
792
 
793
+ /**
794
+ * 调用当前应用的 Tool。
795
+ *
796
+ * 豆包会根据当前智能服务页面或会话 Widget 确定应用和版本,开发者只需传入 Tool 名称和参数。
797
+ * Tool 正常结果通过 `toolResult` 返回,Tool 业务错误通过 `toolError` 返回,两者都会正常
798
+ * resolve;调用前校验、鉴权或返回结构校验失败时 Promise reject。
799
+ *
800
+ * @param params - Tool 名称和参数。
801
+ * @returns Tool 正常结果或业务错误,以及 Widget 场景下可选的更新错误。
802
+ * @example
803
+ * ```typescript
804
+ * import { callTool } from '@doubao-dev/framework/api';
805
+ *
806
+ * const result = await callTool({
807
+ * toolName: 'query_order',
808
+ * toolArgs: {
809
+ * orderId: 'order-123'
810
+ * }
811
+ * });
812
+ *
813
+ * if (result.toolError) {
814
+ * console.warn(result.toolError.code, result.toolError.message);
815
+ * } else {
816
+ * console.log(result.toolResult);
817
+ * }
818
+ * ```
819
+ *
820
+ * @since 0.0.42
821
+ * @contractStatus verified | 公开参数、页面与 Widget 调用场景、Widget 更新控制、互斥返回结构及 Android、iOS 错误字段一致。
822
+ * @containerSupport Page | supported
823
+ * @containerSupport Widget | supported
824
+ * @platformSupport Android | supported | 支持在智能服务页面和会话 Widget 中调用当前应用的 Tool。
825
+ * @platformSupport iOS | supported | 支持在智能服务页面和会话 Widget 中调用当前应用的 Tool。
826
+ * @platformSupport PC | unsupported | 客户端尚未实现 callTool。
827
+ * @platformSupport HarmonyOS | unsupported | 客户端尚未实现 callTool。
828
+ * @permission none | - | none | Android,iOS | 无需额外权限
829
+ * @precondition Android | 在当前应用的智能服务页面或由当前应用真实生成的会话 Widget 内调用,且目标 Tool 已在当前应用版本中配置。
830
+ * @precondition iOS | 在当前应用的智能服务页面或由当前应用真实生成的会话 Widget 内调用,且目标 Tool 已在当前应用版本中配置。
831
+ * @usageNote All | toolResult 与 toolError 互斥;toolError 是正常返回的 Tool 业务错误,不会导致 Promise reject。skipWidgetUpdate 为 true 时不执行 Widget 更新阶段,因此不会返回 cardUpdateError;否则 cardUpdateError 表示 Tool 已执行但当前 Widget 更新失败。重试会再次执行 Tool,请避免重复触发。
832
+ * @resultExample
833
+ * ```json
834
+ * {
835
+ * "toolResult": {
836
+ * "content": [
837
+ * {
838
+ * "type": "text",
839
+ * "text": "订单已支付"
840
+ * }
841
+ * ],
842
+ * "structuredContent": {
843
+ * "orderId": "order-123",
844
+ * "status": "paid"
845
+ * }
846
+ * }
847
+ * }
848
+ * ```
849
+ * @errorExample
850
+ * ```json
851
+ * {
852
+ * "errNo": 104,
853
+ * "errMsg": "invalid parameter"
854
+ * }
855
+ * ```
856
+ * @errorCode common | 102 | Android,iOS
857
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 在 Worker 等非智能服务页面、Widget 容器中调用 | 仅在智能服务页面或会话 Widget 中调用。
858
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | toolName 为空、toolArgs 无法序列化为 JSON 对象,或传入的 skipWidgetUpdate 不是布尔值 | 修正 Tool 名称、参数和 Widget 更新控制参数后重试。
859
+ * @errorCode errNo | 112 | invalid result | Android,iOS | Tool 正常结果、业务错误或 Widget 更新错误结构无效 | 稍后重试;持续失败时反馈 Tool 或服务端返回异常。
860
+ * @platformNote All | 非智能服务页面、Widget 容器返回 103;参数非法返回 104;返回结构无效返回 112;上下文无效、网络或服务端调用失败返回 102。
861
+ *
862
+ * @public
863
+ */
864
+ export declare const callTool: (params: CallToolParams) => Promise<CallToolResult>;
865
+
866
+ /**
867
+ * Tool 正常完成调用后返回的业务错误。
868
+ *
869
+ * @public
870
+ */
871
+ export declare interface CallToolBusinessError {
872
+ /** Tool 业务错误码。 */
873
+ code: number;
874
+ /** Tool 业务错误信息。 */
875
+ message: string;
876
+ }
877
+
878
+ /**
879
+ * Widget 更新阶段的错误。
880
+ *
881
+ * @public
882
+ */
883
+ export declare interface CallToolError {
884
+ /** 错误码。 */
885
+ code: string;
886
+ /** 错误信息。 */
887
+ message: string;
888
+ /** 错误阶段,固定为渲染阶段。 */
889
+ phase: 'render';
890
+ }
891
+
892
+ /**
893
+ * 调用 Tool 的参数。
894
+ *
895
+ * @public
896
+ */
897
+ export declare interface CallToolParams {
898
+ /** 当前应用内需要调用的 Tool 名称。 */
899
+ toolName: string;
900
+ /** Tool 入参。 */
901
+ toolArgs: Record<string, unknown>;
902
+ /**
903
+ * 是否跳过 Widget 更新阶段。设为 `true` 时,即使 Tool 下发 Widget,也只返回 Tool 数据,
904
+ * 不更新当前 Widget。
905
+ *
906
+ * @default false
907
+ * @constraint 仅影响会下发 Widget 的 Tool。
908
+ */
909
+ skipWidgetUpdate?: boolean;
910
+ }
911
+
912
+ /**
913
+ * 调用 Tool 的结果。
914
+ *
915
+ * @public
916
+ */
917
+ export declare type CallToolResult = {
918
+ /**
919
+ * Tool 已执行,但返回结果未能用于更新当前 Widget 时的错误。仅 Widget 场景可能返回。
920
+ *
921
+ * @default -
922
+ */
923
+ cardUpdateError?: CallToolError;
924
+ } & ({
925
+ /** Tool 正常结果,与 `toolError` 二选一。 */
926
+ toolResult: ToolResult;
927
+ /** @hidden */
928
+ toolError?: never;
929
+ } | {
930
+ /** Tool 业务错误,与 `toolResult` 二选一。该字段不会导致 API reject。 */
931
+ toolError: CallToolBusinessError;
932
+ /** @hidden */
933
+ toolResult?: never;
934
+ });
935
+
936
+ /**
937
+ * 摄像头精细授权状态,取值与 {@link BasicAuthorizationDetail} 一致。
938
+ *
939
+ * @public
940
+ */
941
+ export declare type CameraAuthorizationDetail = BasicAuthorizationDetail;
942
+
725
943
  /** @public */
726
944
  export declare interface CanIUseParams {
727
945
  /** 需要检测的能力标识,例如 API 名称 */
@@ -734,6 +952,47 @@ export declare interface CanIUseResult {
734
952
  result: boolean;
735
953
  }
736
954
 
955
+ /**
956
+ * 对话框高度或展示状态变化事件。
957
+ *
958
+ * @public
959
+ */
960
+ export declare type ChatPanelHeightChangedEvent = ChatPanelInfo;
961
+
962
+ /**
963
+ * 对话框高度或展示状态变化监听函数。
964
+ *
965
+ * @public
966
+ */
967
+ export declare type ChatPanelHeightChangedListener = (event: ChatPanelHeightChangedEvent) => void;
968
+
969
+ /**
970
+ * 对话框状态快照。
971
+ *
972
+ * @public
973
+ */
974
+ export declare interface ChatPanelInfo {
975
+ /**
976
+ * 对话框当前占用的垂直高度,单位为逻辑像素(px),不包含系统键盘高度。
977
+ *
978
+ * @constraint 大于等于 0;收起态高度也可能大于 0
979
+ */
980
+ height: number;
981
+ /**
982
+ * 对话框当前展示状态。
983
+ *
984
+ * `preview` 表示从收起态发送消息后、收到回复前的中间态。
985
+ */
986
+ state: ChatPanelState;
987
+ }
988
+
989
+ /**
990
+ * 对话框展示状态。
991
+ *
992
+ * @public
993
+ */
994
+ export declare type ChatPanelState = 'collapsed' | 'expanded' | 'preview';
995
+
737
996
  /**
738
997
  * 检测无障碍能力是否开启。
739
998
  *
@@ -749,6 +1008,7 @@ export declare interface CanIUseResult {
749
1008
  * @since 0.0.25
750
1009
  * @contractStatus verified | open 字段的类型与必返性已与 Android、iOS 当前实现对齐;双端检测的无障碍能力口径不同但公开类型已准确表达
751
1010
  * @contractMismatch non-blocking | behavior | 无障碍能力口径 | Android,iOS | 返回设备是否开启视觉无障碍能力 | Android 检测系统无障碍服务是否开启,iOS 检测 VoiceOver/开关控制是否开启 | 相同返回值在双端代表的具体能力不同 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/AIBridgeAccessibilityMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeAccessibilityMethods.swift | 统一双端无障碍检测口径
1011
+ * @containerSupport Page | supported
752
1012
  * @platformSupport Android | supported | 支持检测无障碍能力
753
1013
  * @platformSupport iOS | supported | 支持检测无障碍能力
754
1014
  * @platformSupport PC | unsupported | 暂不支持
@@ -763,7 +1023,15 @@ export declare interface CanIUseResult {
763
1023
  * "open": false
764
1024
  * }
765
1025
  * ```
766
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息重试
1026
+ * @errorExample
1027
+ * ```json
1028
+ * {
1029
+ * "errNo": 103,
1030
+ * "errMsg": "feature not support"
1031
+ * }
1032
+ * ```
1033
+ * @errorCode common | 102 | Android
1034
+ * @errorCode errNo | 103 | feature not support | Android | 当前运行环境无法获取系统无障碍服务 | 在具备系统无障碍服务的设备上调用。
767
1035
  *
768
1036
  * @public
769
1037
  */
@@ -797,6 +1065,8 @@ export declare interface CheckIsOpenAccessibilityResult {
797
1065
  * @contractStatus conflict | sizeType 不生效,sourceType 仅支持“只传 camera”与相册两种实际分支
798
1066
  * @contractMismatch blocking | parameter | sizeType | Android,iOS | original 和 compressed 控制返回原图或压缩图 | 选择结果不受 sizeType 影响 | 调用方无法控制返回图片尺寸 | packages/open-api/src/media/image.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/media/ChooseImageMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Media/AIBridgeImageMethods.swift; flow_android/business/applet/impl/src/main/java/com/bytedance/applet/impl/AppletHostImageServiceImpl.kt; flow_ios/flow_iOS/Modules/FlowApplet/Sources/AIBridge/FlowAIBridgeService.swift | 补齐双端原图与压缩图选择逻辑,或移除公开字段
799
1067
  * @contractMismatch blocking | parameter | sourceType | Android,iOS | sourceType 数组声明允许的 album、camera、user、environment 来源 | 仅当数组只包含 camera 时打开相机;其他组合均打开相册,user 和 environment 不生效 | 传入多个来源或 user、environment 时实际入口与配置不一致 | packages/open-api/src/media/image.ts; flow_android/business/applet/impl/src/main/java/com/bytedance/applet/impl/AppletHostImageServiceImpl.kt; flow_ios/flow_iOS/Modules/FlowApplet/Sources/AIBridge/FlowAIBridgeService.swift | 实现来源选择和前后摄像头语义,或收敛公开枚举
1068
+ * @containerSupport Page | supported
1069
+ * @containerSupport Widget | unsupported
800
1070
  * @platformSupport Android | supported | 支持从相册选择图片;只传 camera 时支持拍照
801
1071
  * @platformSupport iOS | supported | 支持从相册选择图片;只传 camera 时支持拍照
802
1072
  * @platformSupport PC | unsupported | 暂不支持
@@ -1034,6 +1304,8 @@ export declare type ChooseMessageFileType = 'all' | 'video' | 'image' | 'file';
1034
1304
  *
1035
1305
  * @since 0.0.17
1036
1306
  * @contractStatus verified | 清空语义及 Android、iOS 错误字段已核对一致。
1307
+ * @containerSupport Page | supported
1308
+ * @containerSupport Widget | supported
1037
1309
  * @platformSupport Android | supported | 支持清空当前智能服务的全部本地缓存。
1038
1310
  * @platformSupport iOS | supported | 支持清空当前智能服务的全部本地缓存。
1039
1311
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -1060,6 +1332,8 @@ export declare const clearStorage: (params?: object | undefined) => Promise<obje
1060
1332
  *
1061
1333
  * @since 0.0.19
1062
1334
  * @contractStatus verified | 清空语义及 Android、iOS 错误字段已核对一致。
1335
+ * @containerSupport Page | supported
1336
+ * @containerSupport Widget | supported
1063
1337
  * @platformSupport Android | supported | 支持同步清空当前智能服务的全部本地缓存。
1064
1338
  * @platformSupport iOS | supported | 支持同步清空当前智能服务的全部本地缓存。
1065
1339
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -1130,6 +1404,8 @@ export { close_2 as close }
1130
1404
  * @returns 不包含字段的结果对象。
1131
1405
  * @since 0.0.25
1132
1406
  * @contractStatus verified | 关闭 BLE 连接的入参与返回结构已与 Android、iOS 当前实现对齐
1407
+ * @containerSupport Page | supported
1408
+ * @containerSupport Widget | unsupported
1133
1409
  * @platformSupport Android | supported | 支持关闭 BLE 连接
1134
1410
  * @platformSupport iOS | supported | 支持关闭 BLE 连接
1135
1411
  * @platformSupport PC | unsupported | 暂不支持
@@ -1175,6 +1451,8 @@ export declare interface CloseBLEConnectionParams {
1175
1451
  * @returns 不包含字段的结果对象。
1176
1452
  * @since 0.0.25
1177
1453
  * @contractStatus verified | 关闭蓝牙适配器的入参与返回结构已与 Android、iOS 当前实现对齐
1454
+ * @containerSupport Page | supported
1455
+ * @containerSupport Widget | unsupported
1178
1456
  * @platformSupport Android | supported | 支持关闭蓝牙适配器
1179
1457
  * @platformSupport iOS | supported | 支持关闭蓝牙适配器
1180
1458
  * @platformSupport PC | unsupported | 暂不支持
@@ -1236,6 +1514,8 @@ export declare type CompassChangeListener = (event: CompassChangeEvent) => void;
1236
1514
  * ```
1237
1515
  * @since 0.0.26
1238
1516
  * @contractStatus verified | Android、iOS 均按相同默认质量和尺寸组合规则输出 JPEG 临时文件
1517
+ * @containerSupport Page | supported
1518
+ * @containerSupport Widget | unsupported
1239
1519
  * @platformSupport Android | supported | 支持压缩豆包智能服务本地图片
1240
1520
  * @platformSupport iOS | supported | 支持压缩豆包智能服务本地图片
1241
1521
  * @platformSupport PC | unsupported | 暂不支持
@@ -1364,6 +1644,8 @@ export declare interface ConnectedBluetoothDevice {
1364
1644
  * @since 0.0.30
1365
1645
  * @contractStatus verified | ws 和 wss 均可创建连接,握手结果通过 SocketTask 事件回调通知;SocketTaskOpenEvent.header 恒为空对象已在公开类型说明中表达。
1366
1646
  * @contractMismatch non-blocking | return | SocketTaskOpenEvent.header | Android,iOS | 声明返回握手响应头 | 双端握手成功后该字段固定返回空对象 {} | 调用方无法通过该字段读取服务端握手 Header | packages/open-api/src/network/connect-socket.ts | 暂不对齐,公开类型已补充字段说明
1647
+ * @containerSupport Page | supported
1648
+ * @containerSupport Widget | unsupported
1367
1649
  * @platformSupport Android | supported | 支持 ws 和 wss 协议的 WebSocket 连接。
1368
1650
  * @platformSupport iOS | supported | 支持 ws 和 wss 协议的 WebSocket 连接。
1369
1651
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -1378,7 +1660,23 @@ export declare interface ConnectedBluetoothDevice {
1378
1660
  * "readyState": 0
1379
1661
  * }
1380
1662
  * ```
1381
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
1663
+ * @errorExample
1664
+ * ```json
1665
+ * {
1666
+ * "errNo": 1501001,
1667
+ * "errMsg": "websocket connection limit exceeded"
1668
+ * }
1669
+ * ```
1670
+ * @errorCode common | 102 | Android
1671
+ * @errorCode common | 113 | Android,iOS
1672
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | 创建连接时 url 为空或非 ws/wss,或调用 send 时 base64 数据非法、dataType 不支持 | 传入合法的 ws/wss url 与受支持的发送数据后重试。
1673
+ * @errorCode errNo | 110 | API call prohibited | Android,iOS | socket url 未通过域名白名单校验 | 确认目标域名已在智能服务中配置后重试。
1674
+ * @errorCode errNo | 116 | resource not found | Android,iOS | 对已关闭或不存在的 socketTaskId 调用 send/close | 仅在 onOpen 后、onClose 前操作连接,不要复用已关闭的连接。
1675
+ * @errorCode errNo | 305 | network failure | Android,iOS | 建立连接、发送或关闭过程中发生网络错误 | 检查网络连接,必要时重新建立连接。
1676
+ * @errorCode errNo | 1501001 | websocket connection limit exceeded | Android,iOS | 同一智能服务的 WebSocket 连接数超过上限 | 关闭不再使用的连接后重试。
1677
+ * @errorCode errNo | 1501002 | websocket is not open | iOS | 连接尚未打开或已关闭时调用 send | 在收到 onOpen 事件后再发送数据。
1678
+ * @platformNote Android | 建立连接失败统一返回 102;send 在连接未打开时返回 305 或 116。
1679
+ * @platformNote iOS | send 在连接未打开时返回 1501002。
1382
1680
  *
1383
1681
  * @public
1384
1682
  */
@@ -1387,13 +1685,13 @@ export declare function connectSocket(params: ConnectSocketParams): SocketTask;
1387
1685
  /**
1388
1686
  * 创建 WebSocket 连接的参数。
1389
1687
  *
1390
- * `connectSocket` 会把这些参数透传给宿主侧创建连接。连接创建请求发出后,
1688
+ * `connectSocket` 会把这些参数交给豆包客户端创建连接。连接创建请求发出后,
1391
1689
  * 调用方会立即拿到一个 {@link SocketTask},后续连接成功、失败、收到消息和关闭状态
1392
1690
  * 都通过 `SocketTask` 上注册的事件回调通知。
1393
1691
  *
1394
1692
  * @remarks
1395
- * - `url` 应填写完整的 WebSocket 地址。线上环境通常要求使用 `wss://` 协议,并由宿主侧按当前应用配置校验合法域名和证书。
1396
- * - `header` 用于补充握手请求头,`referer` 等由宿主管控的字段不会被业务代码覆盖。
1693
+ * - `url` 应填写完整的 WebSocket 地址。线上环境通常要求使用 `wss://` 协议,并由豆包客户端按当前智能服务配置校验合法域名和证书。
1694
+ * - `header` 用于补充握手请求头,`referer` 等由豆包客户端管理的字段不会被业务代码覆盖。
1397
1695
  * - `protocols` 非空时,服务端需要在握手响应中选择并返回匹配的子协议,否则连接可能失败。
1398
1696
  * - 同一个页面多次调用会创建多个独立连接,已创建的旧连接不会因为新连接自动关闭。
1399
1697
  *
@@ -1412,7 +1710,7 @@ export declare interface ConnectSocketParams {
1412
1710
  * WebSocket 握手阶段携带的 HTTP Header。
1413
1711
  *
1414
1712
  * 适合放置业务自定义 Header,例如鉴权 token、trace id、客户端能力标识等。
1415
- * `referer` 由宿主侧统一生成和管理,不应依赖该字段被业务传入值覆盖。
1713
+ * `referer` 由豆包客户端统一生成和管理,不应依赖该字段被业务传入值覆盖。
1416
1714
  *
1417
1715
  * @default -
1418
1716
  */
@@ -1422,7 +1720,7 @@ export declare interface ConnectSocketParams {
1422
1720
  *
1423
1721
  * 会作为握手请求中的 `Sec-WebSocket-Protocol` 候选值传给服务端。
1424
1722
  * 如果传入非空数组,服务端需要选择其中一个协议并在握手响应中返回;
1425
- * 服务端不支持或不返回匹配协议时,连接可能被宿主判定为创建失败。
1723
+ * 服务端不支持或不返回匹配协议时,豆包客户端可能判定连接创建失败。
1426
1724
  *
1427
1725
  * @default -
1428
1726
  */
@@ -1447,6 +1745,8 @@ export declare interface ConnectSocketParams {
1447
1745
  * @since 0.0.25
1448
1746
  * @contractStatus conflict | 双端均可连接 Wi-Fi,但 bssid 参数仅 Android 生效
1449
1747
  * @contractMismatch blocking | parameter | bssid | iOS | 通过 bssid 指定连接目标 | 豆包 iOS 的连接实现不接收 bssid,仅按 ssid 与密码连接 | iOS 上传入 bssid 不会生效 | packages/open-api/src/device/wifi/wifi.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/wifi/WifiModuleManager.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/Wifi/AIBridgeWifiManager.swift | 补齐豆包 iOS 按 bssid 连接能力
1748
+ * @containerSupport Page | supported
1749
+ * @containerSupport Widget | unsupported
1450
1750
  * @platformSupport Android | supported | 支持连接 Wi-Fi,可按 bssid 指定目标
1451
1751
  * @platformSupport iOS | supported | 支持连接 Wi-Fi,忽略 bssid 参数
1452
1752
  * @platformSupport PC | unsupported | 暂不支持
@@ -1459,7 +1759,20 @@ export declare interface ConnectSocketParams {
1459
1759
  * ```json
1460
1760
  * {}
1461
1761
  * ```
1462
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据返回的错误信息提示用户重试
1762
+ * @errorExample
1763
+ * ```json
1764
+ * {
1765
+ * "errNo": 1401003,
1766
+ * "errMsg": "connect wifi failed"
1767
+ * }
1768
+ * ```
1769
+ * @errorCode common | 102 | Android,iOS
1770
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | ssid 为空 | 传入非空的 ssid 后重试
1771
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 设备无可用的 Wi-Fi 能力,或 iOS 系统版本过低不支持连接 | 检查设备与系统能力,不支持时不要调用
1772
+ * @errorCode errNo | 1401001 | wifi is not initialized | Android,iOS | 调用前未先调用 startWifi 完成初始化 | 先调用 startWifi 再连接 Wi-Fi
1773
+ * @errorCode errNo | 115 | operation timeout | Android | 连接 Wi-Fi 超时 | 确认目标网络可用后提示用户重试
1774
+ * @errorCode errNo | 1401003 | connect wifi failed | Android,iOS | 连接目标 Wi-Fi 失败(如密码错误、网络不可达、系统连接被拒) | 检查 ssid 与密码后提示用户重试
1775
+ * @platformNote Android | 连接超时返回 115;iOS 未细分超时,连接失败统一归为 1401003。
1463
1776
  *
1464
1777
  * @public
1465
1778
  */
@@ -1516,6 +1829,22 @@ export declare type Content = {
1516
1829
  /** API 调用参数。 */
1517
1830
  arguments: object;
1518
1831
  };
1832
+ } | {
1833
+ /** 模型响应提示。 */
1834
+ type: 'responseHint';
1835
+ /** 用户动作和模型响应建议。 */
1836
+ data: {
1837
+ /**
1838
+ * 用户做了什么。
1839
+ * @default -
1840
+ */
1841
+ userAction?: string;
1842
+ /**
1843
+ * 建议模型如何响应。
1844
+ * @default -
1845
+ */
1846
+ responseGuidance?: string;
1847
+ };
1519
1848
  };
1520
1849
 
1521
1850
  /**
@@ -1556,6 +1885,8 @@ export declare interface CopyFileParams {
1556
1885
  * @returns 不包含字段的结果对象。
1557
1886
  * @since 0.0.25
1558
1887
  * @contractStatus verified | 创建 BLE 连接的入参与返回结构已与 Android、iOS 当前实现对齐
1888
+ * @containerSupport Page | supported
1889
+ * @containerSupport Widget | unsupported
1559
1890
  * @platformSupport Android | supported | 支持创建 BLE 连接
1560
1891
  * @platformSupport iOS | supported | 支持创建 BLE 连接
1561
1892
  * @platformSupport PC | unsupported | 暂不支持
@@ -1595,28 +1926,57 @@ export declare interface CreateBLEConnectionParams {
1595
1926
  }
1596
1927
 
1597
1928
  /**
1598
- * A factory to generate a custom event API pair (for both the caller and the callee)
1929
+ * 创建一组用于发送和监听自定义事件的函数。
1930
+ *
1931
+ * @containerSupport Page | supported
1932
+ * @containerSupport Widget | supported
1933
+ * @public
1934
+ */
1935
+ export declare const createCustomEvent: typeof createCustomEvent_2;
1936
+
1937
+ /**
1938
+ * 创建一组用于发送和监听自定义事件的函数。
1599
1939
  *
1600
- * @param name event name
1601
- * @param options Extra options when generating the event API
1602
- * @returns A custom event API pair
1940
+ * 发送函数会向当前智能服务的其他 Runtime 广播事件;监听注册函数可注册多个处理函数,
1941
+ * 并返回对应的注销函数。发送端和接收端应复用同一份事件定义,确保事件名称和参数类型一致。
1942
+ *
1943
+ * @summary 创建自定义事件。
1944
+ * @param name 事件名称。建议添加业务命名空间,避免与其他事件重名。
1945
+ * @param options 自定义事件配置。省略时不校验接收到的事件参数。
1946
+ * @returns 返回一个元组,第一项用于发送事件,第二项用于注册事件处理函数。
1603
1947
  * @category Custom API
1604
1948
  * @example
1949
+ * ```typescript
1950
+ * import { createCustomEvent } from '@doubao-dev/framework/api';
1951
+ *
1605
1952
  * interface TestEventParams {
1606
1953
  * input: string;
1607
1954
  * }
1608
1955
  *
1609
- * const [emitEvent, onReceiveEvent] = createCustomEvent<TestEventParams>('testEvent');
1956
+ * const [emitEvent, onReceiveEvent] =
1957
+ * createCustomEvent<TestEventParams>('example.testEvent');
1610
1958
  *
1611
- * // For receiver
1612
- * const unregister = onReceiveEvent((params) => console.log(params));
1959
+ * const unregister = onReceiveEvent((params) => {
1960
+ * console.log(params.input);
1961
+ * });
1613
1962
  *
1614
- * // For sender
1615
- * function emitEventToOtherView() {
1616
- * emitEvent({ input: 'test' });
1617
- * }
1963
+ * emitEvent({ input: 'test' });
1964
+ * unregister();
1965
+ * ```
1966
+ *
1967
+ * @since 0.0.1
1968
+ * @contractStatus verified | 自定义事件通过统一 Bridge 消息机制在 Runtime 之间广播和接收。
1969
+ * @platformSupport Android | supported | 支持在智能服务的多个 Runtime 之间发送和接收自定义事件。
1970
+ * @platformSupport iOS | supported | 支持在智能服务的多个 Runtime 之间发送和接收自定义事件。
1971
+ * @platformSupport PC | supported | 支持在智能服务的多个 Runtime 之间发送和接收自定义事件。
1972
+ * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
1973
+ * @permission none | - | none | Android,iOS,PC | 无需额外权限
1974
+ * @precondition All | 发送端与接收端需使用相同的事件名称和参数结构。
1975
+ * @usageNote All | 为事件名称添加业务命名空间,并在不再监听时调用注册函数返回的注销函数。
1976
+ * @errorCode none | - | - | Android,iOS,PC | 该 API 不返回业务错误码,发送失败时不会抛出异常 | 无需处理
1977
+ * @public
1618
1978
  */
1619
- export declare function createCustomEvent<Params extends object>(name: string, options?: CustomEventOptions<Params>): [CustomEventCaller<Params>, CustomEventHandlerRegistry<Params>];
1979
+ declare function createCustomEvent_2<Params extends object>(name: string, options?: CustomEventOptions_2<Params>): [CustomEventCaller_2<Params>, CustomEventHandlerRegistry_2<Params>];
1620
1980
 
1621
1981
  /**
1622
1982
  * 创建一个内部音频上下文。
@@ -1637,6 +1997,8 @@ export declare function createCustomEvent<Params extends object>(name: string, o
1637
1997
  * ```
1638
1998
  * @since 0.0.37
1639
1999
  * @contractStatus verified | Android、iOS 均支持独立实例、属性控制、基础播控和事件监听
2000
+ * @containerSupport Page | supported
2001
+ * @containerSupport Widget | unsupported
1640
2002
  * @platformSupport Android | supported | 支持多实例内部音频播放
1641
2003
  * @platformSupport iOS | supported | 支持多实例内部音频播放
1642
2004
  * @platformSupport PC | unsupported | 暂不支持
@@ -1711,6 +2073,8 @@ export declare function createInnerAudioContext(): InnerAudioContext;
1711
2073
  * @since 0.0.28
1712
2074
  * @contractStatus verified | 成功返回结构与 Android、iOS 一致;失败通过 Promise reject,业务错误在错误对象的 data 字段。公开联合类型的失败分支不会作为 resolve 值出现,仅作后续对齐项。
1713
2075
  * @contractMismatch non-blocking | return | CreateSignOrderResult | Android,iOS | 返回类型声明为 CreateSignOrderSuccessResult 与 CreateSignOrderFailResult 的联合,暗示失败结果可作为 resolve 值 | 双端失败时通过 Promise reject 返回,业务错误(errNo、errMsg、errLogId)在错误对象的 data 字段,resolve 值只会是成功结果 | 调用方误以为可对 await 结果做失败分支判断 | packages/open-api/src/open/payment/create-sign-order.ts; packages/bridge-base/src/client-api.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/payment/CreateSignOrderMethod.kt | 将公开返回类型收敛为成功结果,失败改由错误对象表达
2076
+ * @containerSupport Page | supported
2077
+ * @containerSupport Widget | supported
1714
2078
  * @platformSupport Android | supported | 支持创建签约订单并返回 authOrderId。
1715
2079
  * @platformSupport iOS | supported | 支持创建签约订单并返回 authOrderId。
1716
2080
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -1726,7 +2090,7 @@ export declare function createInnerAudioContext(): InnerAudioContext;
1726
2090
  * "logId": "20260519xxxx"
1727
2091
  * }
1728
2092
  * ```
1729
- * @errorCode none | - | - | Android,iOS | 无稳定的顶层 errNo/errMsg;调用失败时 Promise reject,业务错误(errNo、errMsg、errLogId)在错误对象的 data 字段 | 通过 catch 捕获并读取 e.data 排查
2093
+ * @errorCode common | 102 | Android,iOS
1730
2094
  * @knownIssue All | 失败结果不会作为 await 的返回值,需通过 catch 捕获并从错误对象的 data 字段读取 errNo、errMsg、errLogId。
1731
2095
  *
1732
2096
  * @public
@@ -1806,6 +2170,8 @@ export declare interface CreateSignOrderSuccessResult {
1806
2170
  * @since 0.0.31
1807
2171
  * @contractStatus conflict | 公开定义声明 taskType 支持 local 与 remote,豆包双端仅支持 remote。
1808
2172
  * @contractMismatch blocking | parameter | params.taskType | Android,iOS | 声明支持 local 与 remote 两种任务类型 | 豆包 Android、iOS 仅支持 remote 任务,传入 local 无法按本地任务处理 | 调用方传入 local 时行为与预期不符 | packages/open-api/src/open/business/task.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/task/CreateTaskMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Doubao/AIBridgeCreateTaskMethod.swift | 将 taskType 收敛为 remote,或补齐双端 local 任务实现
2173
+ * @containerSupport Page | supported
2174
+ * @containerSupport Widget | supported
1809
2175
  * @platformSupport Android | supported | 支持创建 remote 任务并返回 taskId、token。
1810
2176
  * @platformSupport iOS | supported | 支持创建 remote 任务并返回 taskId、token。
1811
2177
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -1822,7 +2188,17 @@ export declare interface CreateSignOrderSuccessResult {
1822
2188
  * "expiresIn": 3600
1823
2189
  * }
1824
2190
  * ```
1825
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
2191
+ * @errorExample
2192
+ * ```json
2193
+ * {
2194
+ * "errNo": 104,
2195
+ * "errMsg": "invalid parameter"
2196
+ * }
2197
+ * ```
2198
+ * @errorCode common | 102 | Android,iOS
2199
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | taskType 不是 remote(如传入 local) | 传入 remote 任务类型后重试。
2200
+ * @errorCode errNo | 112 | invalid result | Android,iOS | 远端任务创建成功但返回数据为空或缺少 taskId | 稍后重试;持续失败时反馈服务端响应异常。
2201
+ * @platformNote All | taskType 非 remote 返回 104;远端返回数据为空或缺少 taskId 返回 112;其他失败统一返回 102。
1826
2202
  *
1827
2203
  * @public
1828
2204
  */
@@ -1858,27 +2234,50 @@ export declare interface CreateTaskResult {
1858
2234
  expiresIn?: number;
1859
2235
  }
1860
2236
 
2237
+ /** @public */
2238
+ export declare type CustomEventCaller<Params extends object = object> = CustomEventCaller_2<Params>;
2239
+
1861
2240
  /**
1862
- * The caller part of an event API pair
2241
+ * 自定义事件发送函数。
2242
+ *
2243
+ * 调用后会向当前智能服务的其他 Runtime 广播事件,不返回处理结果。
1863
2244
  *
1864
- * Used to send an event registered at foreign entity.
2245
+ * @public
1865
2246
  */
1866
- export declare type CustomEventCaller<Params extends object = object> = (params: Params) => void;
2247
+ declare type CustomEventCaller_2<Params extends object = object> = (params: Params) => void;
2248
+
2249
+ /** @public */
2250
+ export declare type CustomEventHandlerRegistry<Params extends object = object> = CustomEventHandlerRegistry_2<Params>;
1867
2251
 
1868
2252
  /**
1869
- * The callee part of an event API pair
2253
+ * 自定义事件监听注册函数。
2254
+ *
2255
+ * 可以为同一事件注册多个处理函数。调用返回的函数可注销当前处理函数。
1870
2256
  *
1871
- * Used to register custom event handler.
2257
+ * @public
1872
2258
  */
1873
- export declare type CustomEventHandlerRegistry<Params extends object = object> = (handler: (params: Params) => void) => () => void;
2259
+ declare type CustomEventHandlerRegistry_2<Params extends object = object> = (handler: (params: Params) => void) => () => void;
2260
+
2261
+ /** @public */
2262
+ export declare interface CustomEventOptions<Params extends object> {
2263
+ /**
2264
+ * 接收端的参数类型守卫。返回 `false` 时会忽略当前事件,不调用已注册的处理函数。
2265
+ *
2266
+ * @default -
2267
+ */
2268
+ paramsTypeGuard?: CustomEventOptions_2<Params>['paramsTypeGuard'];
2269
+ }
1874
2270
 
1875
2271
  /**
1876
- * Extra options for custom event factory
2272
+ * 创建自定义事件的配置。
2273
+ *
2274
+ * @public
1877
2275
  */
1878
- export declare interface CustomEventOptions<Params extends object> {
2276
+ declare interface CustomEventOptions_2<Params extends object> {
1879
2277
  /**
1880
- * Applied after the target runtime receives the event message and before passing it to the handler. Will skip the
1881
- * event silently when type guard failed.
2278
+ * 接收端的参数类型守卫。返回 `false` 时会忽略当前事件,不调用已注册的处理函数。
2279
+ *
2280
+ * @default -
1882
2281
  */
1883
2282
  paramsTypeGuard?: TypeGuard<object, Params>;
1884
2283
  }
@@ -1930,6 +2329,8 @@ export declare type DeviceOrientation = 'portrait' | 'landscape';
1930
2329
  * @since 0.0.37
1931
2330
  * @contractStatus verified | 禁止录屏的成功语义已与 Android、iOS 当前实现对齐;双端防护粒度不同但公开类型已准确表达
1932
2331
  * @contractMismatch non-blocking | behavior | 防录屏粒度 | Android,iOS | 禁止当前页面被录屏 | Android 对整个窗口设置 FLAG_SECURE,iOS 对内容视图包裹安全容器保护 | 防护范围在双端不同 | packages/open-api/src/device/screen/disable-user-screen-record.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system/AIBridgeScreenMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeScreenMethods.swift | 统一双端防录屏的作用范围
2332
+ * @containerSupport Page | supported
2333
+ * @containerSupport Widget | unsupported
1933
2334
  * @platformSupport Android | supported | 支持禁止用户录屏
1934
2335
  * @platformSupport iOS | supported | 支持禁止用户录屏
1935
2336
  * @platformSupport PC | unsupported | 暂不支持
@@ -1943,7 +2344,7 @@ export declare type DeviceOrientation = 'portrait' | 'landscape';
1943
2344
  * ```json
1944
2345
  * {}
1945
2346
  * ```
1946
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息重试
2347
+ * @errorCode common | 102 | Android,iOS
1947
2348
  *
1948
2349
  * @public
1949
2350
  */
@@ -1954,6 +2355,7 @@ export declare const disableUserScreenRecord: (params?: {} | undefined) => Promi
1954
2355
  *
1955
2356
  * @param params - 动作描述、预期行为及工具调用约束参数。
1956
2357
  * @returns 返回一个 Promise,在动作指令成功下发时解析。
2358
+ * @deprecated 使用 {@link sendFollowUpMessage} 发送后续消息。
1957
2359
  * @remarks
1958
2360
  * 适用于卡片交互后向模型补充结构化动作上下文,例如按钮点击、选项选择或表单提交。
1959
2361
  * `getWidgetInstanceId` 仅在卡片环境中有效,在智能服务页面中会返回 `undefined`。如果需要在页面中调用,
@@ -1983,9 +2385,18 @@ export declare const disableUserScreenRecord: (params?: {} | undefined) => Promi
1983
2385
  * @precondition Android | 在卡片或会话环境中调用,需传入有效的 widgetInstanceId。
1984
2386
  * @precondition iOS | 在卡片或会话环境中调用,需传入有效的 widgetInstanceId。
1985
2387
  * @usageNote All | 请在卡片交互(按钮点击、选项选择、表单提交)后调用,向模型补充结构化动作上下文。
1986
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
2388
+ * @errorExample
2389
+ * ```json
2390
+ * {
2391
+ * "errNo": 116,
2392
+ * "errMsg": "resource not found"
2393
+ * }
2394
+ * ```
2395
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 当前豆包环境未提供消息下发能力 | 请在支持消息下发的豆包环境中调用。
2396
+ * @errorCode errNo | 116 | resource not found | Android,iOS | 依据 widgetInstanceId 找不到对应会话 | 确认 widgetInstanceId 有效且处于会话环境后重试。
2397
+ * @platformNote All | 找不到会话返回 116;当前豆包环境未提供消息下发能力时返回 103。
1987
2398
  *
1988
- * @public
2399
+ * @internal
1989
2400
  */
1990
2401
  export declare const dispatchActionDirective: (params: DispatchActionDirectiveParams) => Promise<object>;
1991
2402
 
@@ -2094,13 +2505,15 @@ export declare interface DoubaoAppAccountInfo {
2094
2505
  *
2095
2506
  * @since 0.0.40
2096
2507
  * @contractStatus verified | Android、iOS 均支持 HTTPS GET 下载、域名校验、临时或用户目录写入、超时、取消及进度和响应头监听。
2508
+ * @containerSupport Page | supported
2509
+ * @containerSupport Widget | unsupported
2097
2510
  * @platformSupport Android | supported | 支持 HTTPS GET 下载、域名白名单校验、临时或用户目录写入、超时、取消及任务事件监听。
2098
2511
  * @platformSupport iOS | supported | 支持 HTTPS GET 下载、域名白名单校验、临时或用户目录写入、超时、取消及任务事件监听。
2099
2512
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
2100
2513
  * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
2101
2514
  * @permission none | - | none | Android,iOS | 无需额外权限
2102
- * @precondition All | 下载地址需通过宿主侧下载域名白名单校验,单个文件不得超过 200 MB,单个智能服务同时最多执行 10 个下载任务;指定 filePath 时仅支持临时目录或用户目录。
2103
- * @usageNote All | 未指定 filePath 时文件写入临时目录,并通过 Promise resolve 结果的 tempFilePath 返回;临时文件的生命周期由宿主管理。
2515
+ * @precondition All | 下载地址需通过豆包配置的下载域名白名单校验,单个文件不得超过 200 MB,单个智能服务同时最多执行 10 个下载任务;指定 filePath 时仅支持临时目录或用户目录。
2516
+ * @usageNote All | 未指定 filePath 时文件写入临时目录,并通过 Promise resolve 结果的 tempFilePath 返回;临时文件的生命周期由豆包客户端管理。
2104
2517
  * @usageNote All | 不跟随 HTTP 重定向,3xx 响应使 Promise reject;4xx、5xx 响应在文件写入成功后仍使 Promise resolve。
2105
2518
  * @resultExample
2106
2519
  * ```json
@@ -2124,10 +2537,10 @@ export declare function downloadFile(params: DownloadFileParams): DownloadTask;
2124
2537
  * @public
2125
2538
  */
2126
2539
  export declare interface DownloadFileParams {
2127
- /** 下载资源地址,需为完整 HTTPS URL,并通过宿主侧下载域名白名单校验。 */
2540
+ /** 下载资源地址,需为完整 HTTPS URL,并通过豆包配置的下载域名白名单校验。 */
2128
2541
  url: string;
2129
2542
  /**
2130
- * 请求 Header。`referer` 和 `user-agent` 由宿主管控,业务传入值不会透传。
2543
+ * 请求 Header。`referer` 和 `user-agent` 由豆包客户端管理,业务传入值不会透传。
2131
2544
  *
2132
2545
  * @default -
2133
2546
  */
@@ -2213,6 +2626,61 @@ export declare interface DownloadTaskHeadersReceivedEvent {
2213
2626
  header: Record<string, string>;
2214
2627
  }
2215
2628
 
2629
+ /**
2630
+ * 发起抖音支付流程。
2631
+ *
2632
+ * @param params - 支付请求数据。
2633
+ * @returns 返回支付流程的结果对象。
2634
+ * @remarks
2635
+ * `data` 应由业务服务端生成,前端不要自行拼装或修改。
2636
+ *
2637
+ * 支付流程返回不代表最终支付状态,最终结果应以业务服务端查询结果或支付回调为准。
2638
+ * @example
2639
+ * ```typescript
2640
+ * import { dypay } from '@doubao-dev/framework/api';
2641
+ *
2642
+ * // 业务方自行实现:从业务服务端获取支付请求数据;该函数不是 SDK API。
2643
+ * declare function getDypayDataFromBusinessServer(): Promise<string>;
2644
+ *
2645
+ * const data = await getDypayDataFromBusinessServer();
2646
+ * const result = await dypay({ data });
2647
+ *
2648
+ * console.log(result);
2649
+ * ```
2650
+ *
2651
+ * @since 0.0.43
2652
+ * @contractStatus verified | Android、iOS 均支持接收字符串类型的 data 并发起抖音支付流程。
2653
+ * @platformSupport Android | supported | 支持传入 data 发起抖音支付流程。
2654
+ * @platformSupport iOS | supported | 支持传入 data 发起抖音支付流程。
2655
+ * @platformSupport PC | unsupported | 当前未提供该平台实现。
2656
+ * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
2657
+ * @permission none | - | none | Android,iOS | 无需额外权限
2658
+ * @precondition All | 调用前需由业务服务端生成合法的支付请求 data。
2659
+ * @usageNote All | 调用会进入支付流程,请在用户明确触发支付的交互场景中调用;不要在后台逻辑中自动调用。
2660
+ * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 根据调用失败信息提示用户稍后重试
2661
+ * @public
2662
+ */
2663
+ export declare const dypay: (params: DypayParams) => Promise<DypayResult>;
2664
+
2665
+ /** @public */
2666
+ export declare interface DypayParams {
2667
+ /**
2668
+ * 支付请求数据。
2669
+ *
2670
+ * 该字段应由业务服务端按支付接入协议生成,前端需原样透传。
2671
+ */
2672
+ data: string;
2673
+ }
2674
+
2675
+ /**
2676
+ * 支付流程返回的数据对象。
2677
+ *
2678
+ * 具体字段由支付请求对应的业务流程决定。
2679
+ *
2680
+ * @public
2681
+ */
2682
+ export declare type DypayResult = Record<string, unknown>;
2683
+
2216
2684
  /**
2217
2685
  * 允许用户录屏。
2218
2686
  *
@@ -2227,6 +2695,8 @@ export declare interface DownloadTaskHeadersReceivedEvent {
2227
2695
  * @since 0.0.37
2228
2696
  * @contractStatus verified | 允许录屏的成功语义已与 Android、iOS 当前实现对齐;双端恢复机制不同但公开类型已准确表达
2229
2697
  * @contractMismatch non-blocking | behavior | 恢复录屏粒度 | Android,iOS | 恢复当前页面的录屏能力 | Android 清除窗口 FLAG_SECURE,iOS 还原内容视图的安全容器 | 恢复范围在双端不同 | packages/open-api/src/device/screen/enable-user-screen-record.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system/AIBridgeScreenMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeScreenMethods.swift | 统一双端恢复录屏的作用范围
2698
+ * @containerSupport Page | supported
2699
+ * @containerSupport Widget | unsupported
2230
2700
  * @platformSupport Android | supported | 支持允许用户录屏
2231
2701
  * @platformSupport iOS | supported | 支持允许用户录屏
2232
2702
  * @platformSupport PC | unsupported | 暂不支持
@@ -2238,7 +2708,7 @@ export declare interface DownloadTaskHeadersReceivedEvent {
2238
2708
  * ```json
2239
2709
  * {}
2240
2710
  * ```
2241
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息重试
2711
+ * @errorCode common | 102 | Android,iOS
2242
2712
  *
2243
2713
  * @public
2244
2714
  */
@@ -2257,6 +2727,8 @@ export declare const enableUserScreenRecord: (params?: {} | undefined) => Promis
2257
2727
  *
2258
2728
  * @since 0.0.20
2259
2729
  * @contractStatus verified | 退出语义及 Android、iOS 失败字段已核对一致。
2730
+ * @containerSupport Page | supported
2731
+ * @containerSupport Widget | unsupported
2260
2732
  * @platformSupport Android | supported | 支持退出当前智能服务的全部页面。
2261
2733
  * @platformSupport iOS | supported | 支持退出当前智能服务的全部页面。
2262
2734
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -2264,7 +2736,7 @@ export declare const enableUserScreenRecord: (params?: {} | undefined) => Promis
2264
2736
  * @permission none | - | none | Android,iOS | 无需额外权限
2265
2737
  * @precondition All | 无额外前置条件
2266
2738
  * @usageNote All | 会退出当前所有页面;当 navigateBack 已无法继续返回时,使用 exitApp 退出智能服务。
2267
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
2739
+ * @errorCode common | 102 | Android,iOS
2268
2740
  *
2269
2741
  * @public
2270
2742
  */
@@ -2295,6 +2767,8 @@ export declare const exitApp: () => Promise<object>;
2295
2767
  *
2296
2768
  * @since 0.0.27
2297
2769
  * @contractStatus verified | 通过 updateWidget 实现,公开定义与 Android、iOS 的成功、失败路径一致。
2770
+ * @containerSupport Page | supported
2771
+ * @containerSupport Widget | supported
2298
2772
  * @platformSupport Android | supported | 支持将过期卡片更新为固定卡片。
2299
2773
  * @platformSupport iOS | supported | 支持将过期卡片更新为固定卡片。
2300
2774
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -2439,6 +2913,8 @@ export declare interface FileSystemManager {
2439
2913
  * @since 0.0.18
2440
2914
  * @contractStatus conflict | envVersion 公开声明了 trial,但 Android、iOS 当前只返回 develop 或 release。
2441
2915
  * @contractMismatch blocking | return | miniProgram.envVersion | Android,iOS | envVersion 取值为 develop、trial 或 release | 仅返回 develop 或 release,永远不会返回 trial | 依赖 trial 判断体验版环境的逻辑不会生效 | packages/open-api/src/basic/account-info.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/info/GetAccountInfoMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Info/AIBridgeGetAccountInfoMethod.swift | 补齐豆包体验版环境返回 trial,或收敛公开 envVersion 取值
2916
+ * @containerSupport Page | supported
2917
+ * @containerSupport Widget | supported
2442
2918
  * @platformSupport Android | supported | 支持获取当前智能服务账号信息。
2443
2919
  * @platformSupport iOS | supported | 支持获取当前智能服务账号信息。
2444
2920
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -2455,7 +2931,7 @@ export declare interface FileSystemManager {
2455
2931
  * }
2456
2932
  * }
2457
2933
  * ```
2458
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认智能服务运行环境后重试
2934
+ * @errorCode common | 102 | Android
2459
2935
  *
2460
2936
  * @public
2461
2937
  */
@@ -2488,6 +2964,8 @@ export declare interface GetAccountInfoResult {
2488
2964
  * @since 0.0.18
2489
2965
  * @contractStatus conflict | envVersion 公开声明了 trial,但 Android、iOS 当前只返回 develop 或 release。
2490
2966
  * @contractMismatch blocking | return | miniProgram.envVersion | Android,iOS | envVersion 取值为 develop、trial 或 release | 仅返回 develop 或 release,永远不会返回 trial | 依赖 trial 判断体验版环境的逻辑不会生效 | packages/open-api/src/basic/account-info.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/info/GetAccountInfoMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Info/AIBridgeGetAccountInfoMethod.swift | 补齐豆包体验版环境返回 trial,或收敛公开 envVersion 取值
2967
+ * @containerSupport Page | supported
2968
+ * @containerSupport Widget | supported
2491
2969
  * @platformSupport Android | supported | 支持同步获取当前智能服务账号信息。
2492
2970
  * @platformSupport iOS | supported | 支持同步获取当前智能服务账号信息。
2493
2971
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -2504,38 +2982,46 @@ export declare interface GetAccountInfoResult {
2504
2982
  * }
2505
2983
  * }
2506
2984
  * ```
2507
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认智能服务运行环境后重试
2985
+ * @errorCode common | 102 | Android
2508
2986
  *
2509
2987
  * @public
2510
2988
  */
2511
2989
  export declare function getAccountInfoSync(params?: {}): GetAccountInfoResult;
2512
2990
 
2513
2991
  /**
2514
- * 获取宿主应用的系统授权设置。
2992
+ * 获取豆包客户端的系统授权设置。
2515
2993
  *
2516
- * 调用只读取当前系统授权状态,不会申请权限或触发系统授权弹窗。状态字段固定返回
2517
- * `authorized`、`denied` 或 `not determined`。
2994
+ * 调用只读取当前系统授权状态,不会申请权限或触发系统授权弹窗。原有状态字段固定返回
2995
+ * `authorized`、`denied` 或 `not determined`,精细授权字段用于区分部分、只读、只写、前后台等能力。
2518
2996
  *
2519
- * @returns 返回宿主应用相册、蓝牙、摄像头、定位、麦克风、通知和日历权限状态。
2997
+ * @returns 返回豆包客户端的相册、蓝牙、摄像头、定位、麦克风、通知、日历和健康数据系统权限状态。
2520
2998
  * @example
2521
2999
  * ```typescript
2522
3000
  * import { getAppAuthorizeSetting } from '@doubao-dev/framework/api';
2523
3001
  *
2524
3002
  * const result = getAppAuthorizeSetting();
2525
- * console.log(result.cameraAuthorized, result.microphoneAuthorized);
2526
- * console.log(result.notificationAuthorized, result.locationReducedAccuracy);
3003
+ * const detail = result.phoneCalendarAuthorizationDetail;
3004
+ * const canWriteCalendar =
3005
+ * detail === 'full' ||
3006
+ * detail === 'write only' ||
3007
+ * (detail == null && result.phoneCalendarAuthorized === 'authorized');
3008
+ * console.log(canWriteCalendar);
3009
+ * console.log(result.healthDataAuthorizationDetail?.readStatus);
2527
3010
  * ```
2528
3011
  *
2529
3012
  * @since 0.0.40
2530
- * @contractStatus verified | Android 与 iOS 均同步返回固定 11 个字段;除 locationReducedAccuracy 为 boolean 外,其余授权状态字段均限定为 authorized、denied 或 not determined,调用不会触发权限申请。
2531
- * @platformSupport Android | supported | 支持同步读取宿主应用授权状态。
2532
- * @platformSupport iOS | supported | 支持同步读取宿主应用授权状态。
3013
+ * @contractStatus verified | Android 与 iOS 均同步返回原有授权状态及可映射的精细授权字段;精细字段无法可靠映射或平台不适用时可为空,调用不会触发权限申请。
3014
+ * @containerSupport Page | supported
3015
+ * @containerSupport Widget | supported
3016
+ * @platformSupport Android | supported | 支持同步读取豆包客户端的系统权限状态。
3017
+ * @platformSupport iOS | supported | 支持同步读取豆包客户端的系统权限状态。
2533
3018
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
2534
3019
  * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
2535
3020
  * @permission none | - | none | Android,iOS | 无需额外权限
2536
3021
  * @precondition All | 无额外前置条件
2537
- * @usageNote All | 本接口查询宿主应用权限,不等同于查询当前小程序 scope 授权。
3022
+ * @usageNote All | 本接口查询豆包客户端的系统权限,不等同于查询当前智能服务的 scope 授权。
2538
3023
  * @usageNote iOS | SDK 首次完成通知设置异步预热前,或应用重新激活后的刷新尚未完成时,四个通知字段可能仍为旧值或 not determined。
3024
+ * @usageNote iOS | healthDataAuthorizationDetail 使用异步缓存;首次预热或应用重新激活刷新完成前可能返回 UNKNOWN。Apple 不公开精确读取授权,DENIED/GRANTED 为轻量查询推断。
2539
3025
  * @resultExample
2540
3026
  * ```json
2541
3027
  * {
@@ -2549,14 +3035,30 @@ export declare function getAccountInfoSync(params?: {}): GetAccountInfoResult;
2549
3035
  * "notificationAlertAuthorized": "authorized",
2550
3036
  * "notificationBadgeAuthorized": "denied",
2551
3037
  * "notificationSoundAuthorized": "authorized",
2552
- * "phoneCalendarAuthorized": "not determined"
3038
+ * "phoneCalendarAuthorized": "denied",
3039
+ * "albumAuthorizationDetail": "limited",
3040
+ * "bluetoothAuthorizationDetail": "full",
3041
+ * "cameraAuthorizationDetail": "full",
3042
+ * "locationAuthorizationDetail": "foreground precise",
3043
+ * "microphoneAuthorizationDetail": "full",
3044
+ * "notificationAuthorizationDetail": "provisional",
3045
+ * "phoneCalendarAuthorizationDetail": "write only",
3046
+ * "healthDataAuthorizationDetail": {
3047
+ * "readStatus": [
3048
+ * { "type": "heart_rate", "status": 2 },
3049
+ * { "type": "step_count", "status": 0 }
3050
+ * ]
3051
+ * }
2553
3052
  * }
2554
3053
  * ```
2555
3054
  * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
2556
3055
  * @platformNote Android | albumAuthorized 和通知分项固定返回 not determined,locationReducedAccuracy 固定返回 false 且不表示实际定位精度
2557
3056
  * @platformNote Android | bluetoothAuthorized、cameraAuthorized、locationAuthorized、microphoneAuthorized、notificationAuthorized 和 phoneCalendarAuthorized 不区分尚未申请和已经拒绝,两种情况均返回 denied
2558
3057
  * @platformNote Android | locationAuthorized 在粗略或精确定位任一权限已授权时返回 authorized;phoneCalendarAuthorized 仅在读、写日历权限均授权时返回 authorized
3058
+ * @platformNote Android | 精细字段区分 Android 14 部分相册、日历读写、定位前后台和精度,以及蓝牙部分子权限
2559
3059
  * @platformNote iOS | 相册 limited 映射为 authorized,通知 provisional 和 ephemeral 映射为 authorized
3060
+ * @platformNote iOS | 精细字段区分相册 limited/add only、日历 write only、定位前后台和精度,以及通知 provisional;ephemeral 暂不映射
3061
+ * @platformNote iOS | healthDataAuthorizationDetail 返回 SDK 支持的全部健康类型,调用方可按自己申请读取权限时使用的 types 过滤;它不等同于 Apple 提供的精确读取授权结果
2560
3062
  *
2561
3063
  * @public
2562
3064
  */
@@ -2586,12 +3088,63 @@ export declare interface GetAppAuthorizeSettingResult {
2586
3088
  notificationSoundAuthorized: AppAuthorizeStatus;
2587
3089
  /** 系统日历授权状态 */
2588
3090
  phoneCalendarAuthorized: AppAuthorizeStatus;
3091
+ /**
3092
+ * 相册精细授权状态;旧客户端或无法可靠映射时不返回该字段或返回 `null`。
3093
+ *
3094
+ * 继承 {@link BasicAuthorizationDetail} 的全部取值,并增加:
3095
+ * - `limited`:只能访问用户选择的部分照片;支持 iOS 和 Android 14 及以上版本。
3096
+ * - `add only`:只能向相册添加照片,不能读取相册内容;仅 iOS 支持。
3097
+ */
3098
+ albumAuthorizationDetail?: AlbumAuthorizationDetail | null;
3099
+ /**
3100
+ * 蓝牙精细授权状态;旧客户端或无法可靠映射时不返回该字段或返回 `null`。
3101
+ *
3102
+ * 继承 {@link BasicAuthorizationDetail} 的全部取值,并增加:
3103
+ * - `partial`:只获得部分已声明的蓝牙子权限;仅 Android 支持。
3104
+ */
3105
+ bluetoothAuthorizationDetail?: BluetoothAuthorizationDetail | null;
3106
+ /** 摄像头精细授权状态,取值与 {@link BasicAuthorizationDetail} 一致;旧客户端或无法可靠映射时不返回该字段或返回 `null`。 */
3107
+ cameraAuthorizationDetail?: CameraAuthorizationDetail | null;
3108
+ /**
3109
+ * 定位精细授权状态;旧客户端或无法可靠映射时不返回该字段或返回 `null`。
3110
+ *
3111
+ * 继承 {@link UnauthorizedDetail} 的全部取值;获得权限时返回:
3112
+ * - `foreground approximate`:仅应用在前台时可以获取模糊定位。
3113
+ * - `foreground precise`:仅应用在前台时可以获取精确定位。
3114
+ * - `background approximate`:应用在前台或后台时均可以获取模糊定位。
3115
+ * - `background precise`:应用在前台或后台时均可以获取精确定位。
3116
+ */
3117
+ locationAuthorizationDetail?: LocationAuthorizationDetail | null;
3118
+ /** 麦克风精细授权状态,取值与 {@link BasicAuthorizationDetail} 一致;旧客户端或无法可靠映射时不返回该字段或返回 `null`。 */
3119
+ microphoneAuthorizationDetail?: MicrophoneAuthorizationDetail | null;
3120
+ /**
3121
+ * 通知精细授权状态;旧客户端或无法可靠映射时不返回该字段或返回 `null`。
3122
+ *
3123
+ * 继承 {@link BasicAuthorizationDetail} 的全部取值,并增加:
3124
+ * - `provisional`:iOS 临时静默授权;不会弹出授权框,通知只进入通知中心。
3125
+ */
3126
+ notificationAuthorizationDetail?: NotificationAuthorizationDetail | null;
3127
+ /**
3128
+ * 系统日历精细授权状态;旧客户端或无法可靠映射时不返回该字段或返回 `null`。
3129
+ *
3130
+ * 继承 {@link BasicAuthorizationDetail} 的全部取值,并增加:
3131
+ * - `read only`:只能读取日历,不能新增、修改或删除日程;仅 Android 支持。
3132
+ * - `write only`:只能新增日程,不能读取现有日历数据。
3133
+ */
3134
+ phoneCalendarAuthorizationDetail?: PhoneCalendarAuthorizationDetail | null;
3135
+ /**
3136
+ * HealthKit 逐类型读取授权状态;仅 iOS 新版本客户端返回。
3137
+ *
3138
+ * Apple 不提供读取权限的精确查询接口。`status` 为 1 或 2 时采用轻量查询推断,
3139
+ * “已授权但没有数据”和“拒绝读取”仍可能无法可靠区分;业务应以实际读取结果为准。
3140
+ */
3141
+ healthDataAuthorizationDetail?: HealthDataAuthorizationDetail | null;
2589
3142
  }
2590
3143
 
2591
3144
  /**
2592
3145
  * 获取应用基础信息。
2593
3146
  *
2594
- * @returns 返回 SDK 版本、调试开关、宿主信息、语言和主题等字段,见 {@link GetAppBaseInfoResult}。
3147
+ * @returns 返回 SDK 版本、调试开关、豆包客户端信息、语言和主题等字段,见 {@link GetAppBaseInfoResult}。
2595
3148
  * @example
2596
3149
  * ```typescript
2597
3150
  * import { getAppBaseInfo } from '@doubao-dev/framework/api';
@@ -2605,6 +3158,8 @@ export declare interface GetAppAuthorizeSettingResult {
2605
3158
  * @since 0.0.18
2606
3159
  * @contractStatus conflict | Android 已实现异步应用基础信息接口,iOS 当前未注册 doubao.getAppBaseInfo,iOS 上调用会失败。
2607
3160
  * @contractMismatch blocking | platform | doubao.getAppBaseInfo | iOS | iOS 异步返回应用基础信息 | iOS 仅提供接口声明未注册实现,调用直接返回不支持 | iOS 上的异步调用无法获得成功结果 | packages/open-api/src/basic/system/system.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/System | 补齐 iOS doubao.getAppBaseInfo 实现,或统一改用 getAppBaseInfoSync
3161
+ * @containerSupport Page | supported
3162
+ * @containerSupport Widget | supported
2608
3163
  * @platformSupport Android | supported | 支持异步获取应用基础信息。
2609
3164
  * @platformSupport iOS | unsupported | 未注册异步应用基础信息接口,请改用 getAppBaseInfoSync。
2610
3165
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -2636,11 +3191,11 @@ export declare interface GetAppBaseInfoResult {
2636
3191
  SDKVersion?: string;
2637
3192
  /** 是否已打开调试 */
2638
3193
  enableDebug?: boolean;
2639
- /** 当前豆包 App 运行的宿主环境 */
3194
+ /** 当前豆包客户端信息 */
2640
3195
  host?: AppBaseInfoHost;
2641
3196
  /** 当前语言 */
2642
3197
  language: string;
2643
- /** 宿主版本号 */
3198
+ /** 豆包客户端版本号 */
2644
3199
  version?: string;
2645
3200
  /** 当前主题 */
2646
3201
  theme?: 'light' | 'dark';
@@ -2649,7 +3204,7 @@ export declare interface GetAppBaseInfoResult {
2649
3204
  /**
2650
3205
  * 获取应用基础信息。
2651
3206
  *
2652
- * @returns 返回 SDK 版本、调试开关、宿主信息、语言和主题等字段,见 {@link GetAppBaseInfoResult}。
3207
+ * @returns 返回 SDK 版本、调试开关、豆包客户端信息、语言和主题等字段,见 {@link GetAppBaseInfoResult}。
2653
3208
  * @example
2654
3209
  * ```typescript
2655
3210
  * import { getAppBaseInfoSync } from '@doubao-dev/framework/api';
@@ -2662,6 +3217,8 @@ export declare interface GetAppBaseInfoResult {
2662
3217
  *
2663
3218
  * @since 0.0.18
2664
3219
  * @contractStatus verified | 应用基础信息由智能服务运行环境同步读取,字段与公开类型一致。
3220
+ * @containerSupport Page | supported
3221
+ * @containerSupport Widget | supported
2665
3222
  * @platformSupport Android | supported | 支持同步获取应用基础信息。
2666
3223
  * @platformSupport iOS | supported | 支持同步获取应用基础信息。
2667
3224
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -2703,6 +3260,8 @@ export declare const getAppBaseInfoSync: (_params?: {}) => GetAppBaseInfoResult;
2703
3260
  * ```
2704
3261
  * @since 0.0.37
2705
3262
  * @contractStatus verified | Android、iOS 均支持全局单例、背景播控、状态属性和事件监听
3263
+ * @containerSupport Page | supported
3264
+ * @containerSupport Widget | unsupported
2706
3265
  * @platformSupport Android | supported | 支持背景音频播放和系统媒体控件
2707
3266
  * @platformSupport iOS | supported | 支持背景音频播放和系统媒体控件
2708
3267
  * @platformSupport PC | unsupported | 暂不支持
@@ -2760,6 +3319,8 @@ export declare function getBackgroundAudioManager(): BackgroundAudioManager;
2760
3319
  * @since 0.0.25
2761
3320
  * @contractStatus conflict | level 电量取值范围双端不一致,无法从公开类型判断实际区间
2762
3321
  * @contractMismatch blocking | return | level | Android,iOS | 返回当前电量百分比 | Android 返回 0 到 100,iOS 由系统电量换算后可能返回 0 | 依赖固定下限的调用方在低电量时可能误判 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/AIBridgeBatteryMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeBatteryMethods.swift | 统一双端电量下限并明确取值范围
3322
+ * @containerSupport Page | supported
3323
+ * @containerSupport Widget | unsupported
2763
3324
  * @platformSupport Android | supported | 支持获取电池信息
2764
3325
  * @platformSupport iOS | supported | 支持获取电池信息
2765
3326
  * @platformSupport PC | unsupported | 暂不支持
@@ -2774,7 +3335,7 @@ export declare function getBackgroundAudioManager(): BackgroundAudioManager;
2774
3335
  * "level": 82
2775
3336
  * }
2776
3337
  * ```
2777
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息重试
3338
+ * @errorCode common | 102 | Android
2778
3339
  *
2779
3340
  * @public
2780
3341
  */
@@ -2810,6 +3371,8 @@ export declare interface GetBatteryInfoResult {
2810
3371
  * @since 0.0.25
2811
3372
  * @contractStatus verified | 返回的 beacons 列表字段与公开类型一致;双端权限与失败行为不同但不影响公开契约
2812
3373
  * @contractMismatch non-blocking | behavior | 失败行为 | Android,iOS | 返回当前已搜到的 iBeacon 列表 | Android 需定位与蓝牙权限、缺失时可能失败,iOS 恒返回成功 | 双端失败可能性不同,但公开成功语义一致 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/GetBeaconsMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeDeviceBeaconMethods.swift | 统一双端获取列表的权限与成功行为
3374
+ * @containerSupport Page | supported
3375
+ * @containerSupport Widget | unsupported
2813
3376
  * @platformSupport Android | supported | 支持获取已搜索到的 iBeacon 列表
2814
3377
  * @platformSupport iOS | supported | 支持获取已搜索到的 iBeacon 列表
2815
3378
  * @platformSupport PC | unsupported | 暂不支持
@@ -2878,6 +3441,8 @@ export declare interface GetBeaconsResult {
2878
3441
  *
2879
3442
  * @since 0.0.25
2880
3443
  * @contractStatus verified | BLE 特征值列表的入参与返回结构已与 Android、iOS 当前实现对齐
3444
+ * @containerSupport Page | supported
3445
+ * @containerSupport Widget | unsupported
2881
3446
  * @platformSupport Android | supported | 支持获取 BLE 特征值列表
2882
3447
  * @platformSupport iOS | supported | 支持获取 BLE 特征值列表
2883
3448
  * @platformSupport PC | unsupported | 暂不支持
@@ -2948,6 +3513,8 @@ export declare interface GetBLEDeviceCharacteristicsResult {
2948
3513
  *
2949
3514
  * @since 0.0.25
2950
3515
  * @contractStatus verified | BLE RSSI 的入参与返回结构已与 Android、iOS 当前实现对齐
3516
+ * @containerSupport Page | supported
3517
+ * @containerSupport Widget | unsupported
2951
3518
  * @platformSupport Android | supported | 支持获取 BLE 设备 RSSI
2952
3519
  * @platformSupport iOS | supported | 支持获取 BLE 设备 RSSI
2953
3520
  * @platformSupport PC | unsupported | 暂不支持
@@ -3006,6 +3573,8 @@ export declare interface GetBLEDeviceRSSIResult {
3006
3573
  *
3007
3574
  * @since 0.0.25
3008
3575
  * @contractStatus verified | BLE 服务列表的入参与返回结构已与 Android、iOS 当前实现对齐
3576
+ * @containerSupport Page | supported
3577
+ * @containerSupport Widget | unsupported
3009
3578
  * @platformSupport Android | supported | 支持获取 BLE 服务列表
3010
3579
  * @platformSupport iOS | supported | 支持获取 BLE 服务列表
3011
3580
  * @platformSupport PC | unsupported | 暂不支持
@@ -3067,6 +3636,8 @@ export declare interface GetBLEDeviceServicesResult {
3067
3636
  *
3068
3637
  * @since 0.0.25
3069
3638
  * @contractStatus verified | 获取 BLE MTU 的入参与返回结构已与 Android、iOS 当前实现对齐
3639
+ * @containerSupport Page | supported
3640
+ * @containerSupport Widget | unsupported
3070
3641
  * @platformSupport Android | supported | 支持获取 BLE MTU
3071
3642
  * @platformSupport iOS | supported | 支持获取 BLE MTU
3072
3643
  * @platformSupport PC | unsupported | 暂不支持
@@ -3129,6 +3700,8 @@ export declare interface GetBLEMTUResult {
3129
3700
  *
3130
3701
  * @since 0.0.25
3131
3702
  * @contractStatus verified | 蓝牙适配器状态的返回结构已与 Android、iOS 当前实现对齐
3703
+ * @containerSupport Page | supported
3704
+ * @containerSupport Widget | unsupported
3132
3705
  * @platformSupport Android | supported | 支持获取蓝牙适配器状态
3133
3706
  * @platformSupport iOS | supported | 支持获取蓝牙适配器状态
3134
3707
  * @platformSupport PC | unsupported | 暂不支持
@@ -3179,6 +3752,8 @@ export declare interface GetBluetoothAdapterStateResult {
3179
3752
  *
3180
3753
  * @since 0.0.25
3181
3754
  * @contractStatus verified | 已发现设备列表的返回结构已与 Android、iOS 当前实现对齐;广播二进制字段由框架统一解码为 ArrayBuffer
3755
+ * @containerSupport Page | supported
3756
+ * @containerSupport Widget | unsupported
3182
3757
  * @platformSupport Android | supported | 支持获取已发现的蓝牙设备列表
3183
3758
  * @platformSupport iOS | supported | 支持获取已发现的蓝牙设备列表
3184
3759
  * @platformSupport PC | unsupported | 暂不支持
@@ -3217,6 +3792,42 @@ export declare interface GetBluetoothDevicesResult {
3217
3792
  devices: BluetoothDevice[];
3218
3793
  }
3219
3794
 
3795
+ /**
3796
+ * 获取当前对话框状态快照。
3797
+ *
3798
+ * 调用不会改变对话框状态,也不会触发高度变化事件。
3799
+ *
3800
+ * @example
3801
+ * ```typescript
3802
+ * import { getChatPanelInfo } from '@doubao-dev/framework/api';
3803
+ *
3804
+ * const { height, state } = await getChatPanelInfo();
3805
+ * console.log('current chat panel', { height, state });
3806
+ * ```
3807
+ * @since 0.0.42
3808
+ * @contractStatus verified | 请求参数、返回字段和状态枚举与对话框状态查询协议一致。
3809
+ * @containerSupport Page | supported
3810
+ * @containerSupport Widget | unsupported
3811
+ * @platformSupport Android | supported | 支持获取当前对话框状态快照。
3812
+ * @platformSupport iOS | supported | 支持获取当前对话框状态快照。
3813
+ * @platformSupport PC | unsupported | 当前未提供该平台实现。
3814
+ * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
3815
+ * @permission none | - | none | Android,iOS | 无需额外权限
3816
+ * @precondition All | 当前页面需在 app.config.ts 中声明 chat.enabled 为 true
3817
+ * @usageNote All | 调用只读取当前状态,不会改变对话框状态或触发高度变化事件。
3818
+ * @resultExample
3819
+ * ```json
3820
+ * {
3821
+ * "height": 336,
3822
+ * "state": "expanded"
3823
+ * }
3824
+ * ```
3825
+ * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
3826
+ *
3827
+ * @public
3828
+ */
3829
+ export declare const getChatPanelInfo: (params?: {} | undefined) => Promise<ChatPanelInfo>;
3830
+
3220
3831
  /**
3221
3832
  * 获取剪贴板内容。
3222
3833
  *
@@ -3231,6 +3842,8 @@ export declare interface GetBluetoothDevicesResult {
3231
3842
  *
3232
3843
  * @since 0.0.25
3233
3844
  * @contractStatus verified | data 字段的类型与必返性已与 Android、iOS 当前实现对齐
3845
+ * @containerSupport Page | supported
3846
+ * @containerSupport Widget | supported
3234
3847
  * @platformSupport Android | supported | 支持读取剪贴板
3235
3848
  * @platformSupport iOS | supported | 支持读取剪贴板
3236
3849
  * @platformSupport PC | unsupported | 暂不支持
@@ -3245,7 +3858,15 @@ export declare interface GetBluetoothDevicesResult {
3245
3858
  * "data": "hello doubao"
3246
3859
  * }
3247
3860
  * ```
3248
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认豆包是否提供剪贴板能力
3861
+ * @errorExample
3862
+ * ```json
3863
+ * {
3864
+ * "errNo": 103,
3865
+ * "errMsg": "feature not support"
3866
+ * }
3867
+ * ```
3868
+ * @errorCode common | 102 | Android,iOS
3869
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 当前豆包版本或运行环境未提供剪贴板读取能力 | 在支持剪贴板能力的豆包版本中调用。
3249
3870
  *
3250
3871
  * @public
3251
3872
  */
@@ -3277,6 +3898,8 @@ export declare interface GetClipboardDataResult {
3277
3898
  *
3278
3899
  * @since 0.0.25
3279
3900
  * @contractStatus verified | 已连接设备列表的入参与返回结构已与 Android、iOS 当前实现对齐
3901
+ * @containerSupport Page | supported
3902
+ * @containerSupport Widget | unsupported
3280
3903
  * @platformSupport Android | supported | 支持获取已连接的蓝牙设备列表
3281
3904
  * @platformSupport iOS | supported | 支持获取已连接的蓝牙设备列表
3282
3905
  * @platformSupport PC | unsupported | 暂不支持
@@ -3340,6 +3963,8 @@ export declare interface GetConnectedBluetoothDevicesResult {
3340
3963
  * @contractStatus conflict | 双端均可获取已连接 Wi-Fi,但 signalStrength 量纲不一致且 iOS 无 frequency
3341
3964
  * @contractMismatch blocking | return | signalStrength | Android,iOS | 返回统一量纲的信号强度 | 豆包 Android 返回 0 到 100 的信号等级,iOS 返回 0 到 1 的归一化值 | 跨端使用同一阈值判断信号强弱会出错 | packages/open-api/src/device/wifi/wifi.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/wifi/WifiInfoReader.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/Wifi/AIBridgeWifiInfoReader.swift | 统一双端 signalStrength 量纲
3342
3965
  * @contractMismatch non-blocking | return | frequency | iOS | 返回 Wi-Fi 频段 | 豆包 iOS 无法获取频段,frequency 恒为空 | iOS 上无法读取 Wi-Fi 频段 | packages/open-api/src/device/wifi/wifi.ts; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/Wifi/AIBridgeWifiInfoReader.swift | 记录 iOS 无频段能力
3966
+ * @containerSupport Page | supported
3967
+ * @containerSupport Widget | unsupported
3343
3968
  * @platformSupport Android | supported | 支持获取已连接 Wi-Fi,signalStrength 为 0 到 100
3344
3969
  * @platformSupport iOS | supported | 支持获取已连接 Wi-Fi,signalStrength 为 0 到 1 且无 frequency
3345
3970
  * @platformSupport PC | unsupported | 暂不支持
@@ -3362,7 +3987,26 @@ export declare interface GetConnectedBluetoothDevicesResult {
3362
3987
  * }
3363
3988
  * }
3364
3989
  * ```
3365
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据返回的错误信息(如未连接、无权限)提示用户
3990
+ * @errorExample
3991
+ * ```json
3992
+ * {
3993
+ * "errNo": 1401002,
3994
+ * "errMsg": "wifi is not connected"
3995
+ * }
3996
+ * ```
3997
+ * @errorCode common | 102 | Android,iOS
3998
+ * @errorCode errNo | 1401001 | wifi is not initialized | Android,iOS | 调用前未先调用 startWifi 完成初始化 | 先调用 startWifi 再获取已连接 Wi-Fi
3999
+ * @errorCode errNo | 1401002 | wifi is not connected | Android,iOS | 当前未连接 Wi-Fi 或无法读取已连接 Wi-Fi 信息 | 确认设备已连接 Wi-Fi 后重试
4000
+ * @errorCode errNo | 106 | system permission denied | iOS | 系统定位服务未开启,无法读取 Wi-Fi 信息 | 引导用户在系统设置中开启定位服务
4001
+ * @errorCode errNo | 107 | user permission denied | iOS | 用户未授予定位权限或未开启精确定位 | 引导用户授予定位权限并开启精确定位
4002
+ * @errorCode errNo | 114 | operation cancelled | iOS | 用户取消了位置权限授权弹窗 | 用户需要时可再次触发授权后重试
4003
+ * @errorCode errNo | 301 | network request cancelled | iOS | 位置授权过程中的网络请求被取消 | 确认应用和网络状态后重试
4004
+ * @errorCode errNo | 302 | connection timed out | iOS | 位置授权过程中的网络连接超时 | 检查网络连接后重试
4005
+ * @errorCode errNo | 303 | no network connection | iOS | 当前无可用网络连接 | 恢复网络连接后重试
4006
+ * @errorCode errNo | 305 | network failure | iOS | 位置授权过程中发生其他网络错误 | 检查网络连接,稍后重试
4007
+ * @errorCode errNo | 112 | invalid result | iOS | 位置授权服务返回的数据无法解析 | 稍后重试;持续失败时反馈服务端响应异常
4008
+ * @platformNote Android | 未连接或因缺少定位权限无法读取时统一返回 1401002;未初始化返回 1401001。
4009
+ * @platformNote iOS | 读取前会发起位置权限授权,可返回 106/107 及授权网络类失败(301/302/303/305/112);读取阶段未连接返回 1401002。
3366
4010
  *
3367
4011
  * @public
3368
4012
  */
@@ -3407,6 +4051,8 @@ export declare interface GetConnectedWifiResult {
3407
4051
  * ```
3408
4052
  * @since 0.0.32
3409
4053
  * @contractStatus verified | 设备信息字段的类型、必返性与平台可选性已与 Android、iOS 当前实现对齐
4054
+ * @containerSupport Page | supported
4055
+ * @containerSupport Widget | supported
3410
4056
  * @platformSupport Android | supported | 支持获取设备信息
3411
4057
  * @platformSupport iOS | supported | 支持获取设备信息
3412
4058
  * @platformSupport PC | unsupported | 暂不支持
@@ -3438,7 +4084,7 @@ export declare const getDeviceInfo: (params?: {} | undefined) => Promise<GetDevi
3438
4084
  * @public
3439
4085
  */
3440
4086
  export declare interface GetDeviceInfoResult {
3441
- /** 宿主 App 二进制接口类型,仅 Android 支持。 */
4087
+ /** 豆包客户端二进制接口类型,仅 Android 支持。 */
3442
4088
  abi?: string;
3443
4089
  /** 设备二进制接口类型,仅 Android 支持。 */
3444
4090
  deviceAbi?: string;
@@ -3473,13 +4119,15 @@ export declare interface GetDeviceInfoResult {
3473
4119
  * ```
3474
4120
  * @since 0.0.32
3475
4121
  * @contractStatus verified | 同步设备信息由智能服务运行环境 globalProps 读取,字段类型与公开类型一致
4122
+ * @containerSupport Page | supported
4123
+ * @containerSupport Widget | supported
3476
4124
  * @platformSupport Android | supported | 支持同步获取设备信息
3477
4125
  * @platformSupport iOS | supported | 支持同步获取设备信息
3478
4126
  * @platformSupport PC | unsupported | 暂不支持
3479
4127
  * @platformSupport HarmonyOS | unsupported | 暂不支持
3480
4128
  * @permission none | - | none | Android,iOS | 无需额外权限
3481
4129
  * @precondition All | 无额外前置条件
3482
- * @usageNote All | `benchmarkLevel`、`memorySize`、`deviceAbi` 和 `cpuType` 取自 globalProps;运行环境未注入时,`benchmarkLevel` 返回 -1,`memorySize` 返回空字符串,可选字段不返回
4130
+ * @usageNote All | `platform` 优先取自 globalProps.platform,未注入时由 globalProps.os 推导;`benchmarkLevel`、`memorySize`、`deviceAbi` 和 `cpuType` 也取自 globalProps
3483
4131
  * @platformNote Android | `abi`、`deviceAbi`、`cpuType` 仅在运行环境注入对应 globalProps 字段时返回
3484
4132
  * @platformNote iOS | 未注入时不返回 `abi`、`deviceAbi`、`cpuType`
3485
4133
  * @resultExample
@@ -3557,6 +4205,8 @@ export declare interface GetFileInfoResult {
3557
4205
  * @since 0.0.31
3558
4206
  * @contractStatus verified | Android、iOS 均支持文件系统管理器的读写、目录、状态、保存与解压能力,同步与异步方法行为一致
3559
4207
  * @contractMismatch non-blocking | default | ReadFileParams.encoding | Android,iOS | readFile、readFileSync 的 encoding 默认值为 'base64',而 writeFile、appendFile 的 encoding 默认值为 'utf-8' | 双端实现与声明一致:读文件省略 encoding 默认按 Base64 返回,写入、追加省略 encoding 默认按 UTF-8 处理 | 读写默认编码方向不一致,写后再读若都不传 encoding 会得到与写入不匹配的字符串编码 | packages/open-api/src/file-system/file-system-manager.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/file/ReadFileMethod.kt; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/file/WriteFileMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/File/AIBridgeFileMethods.swift | 后续统一读写默认编码方向,建议评估将读文件默认改为 utf-8 并同步双端实现
4208
+ * @containerSupport Page | supported
4209
+ * @containerSupport Widget | unsupported
3560
4210
  * @platformSupport Android | supported | 支持全部读写、目录、状态、保存与解压方法,同步与异步均可用
3561
4211
  * @platformSupport iOS | supported | 支持全部读写、目录、状态、保存与解压方法,同步与异步均可用
3562
4212
  * @platformSupport PC | unsupported | 暂不支持
@@ -3564,7 +4214,21 @@ export declare interface GetFileInfoResult {
3564
4214
  * @permission none | - | none | Android,iOS | 无需额外权限
3565
4215
  * @precondition All | 无额外前置条件,直接调用 getFileSystemManager 获取管理器实例后再调用其方法
3566
4216
  * @usageNote All | readFile、readFileSync 省略 encoding 时默认返回 Base64 字符串,writeFile、appendFile 省略 encoding 时默认按 UTF-8 写入;需要明确编码时请显式传入 encoding。
3567
- * @errorCode none | - | - | Android,iOS | 文件操作失败时对应方法会 reject 或抛出异常,错误信息通过 errMsg 描述,当前不提供稳定的业务错误码 | 根据 errMsg 检查路径、权限与参数后重试
4217
+ * @errorExample
4218
+ * ```json
4219
+ * {
4220
+ * "errNo": 203,
4221
+ * "errMsg": "file does not exist"
4222
+ * }
4223
+ * ```
4224
+ * @errorCode common | 102 | Android,iOS
4225
+ * @errorCode common | 103 | Android
4226
+ * @errorCode common | 104 | Android,iOS
4227
+ * @errorCode errNo | 203 | file does not exist | Android,iOS | readFile、stat、getFileInfo、copyFile、rename、truncate、unlink、rmdir、removeSavedFile、unzip 等操作的目标文件或目录不存在 | 确认路径存在或先创建后重试。
4228
+ * @errorCode errNo | 213 | invalid file path | Android,iOS | 传入的路径不是合法的沙箱内 appletfile 路径,或试图越过沙箱根目录访问 | 使用应用沙箱内的合法本地路径后重试。
4229
+ * @errorCode errNo | 208 | total size limit exceeded | Android,iOS | readFile、writeFile、appendFile、copyFile 时单次读写超过单文件大小上限,或写入后超出沙箱存储配额 | 减小单次读写数据量或清理已保存文件后重试。
4230
+ * @errorCode errNo | 1901001 | target is a directory | Android,iOS | 对目录执行了仅适用于文件的操作(如 readFile、writeFile、appendFile、copyFile、truncate、getFileInfo、unzip 的源文件),或 rmdir 删除非空目录时未开启 recursive | 改为对文件操作,或删除目录时开启 recursive。
4231
+ * @errorCode errNo | 1901002 | target is not a directory | Android,iOS | 对文件执行了仅适用于目录的操作(如 readdir),或 mkdir 目标已存在同名文件、unzip 的 targetPath 不是目录 | 确认目标为目录后重试。
3568
4232
  * @public
3569
4233
  */
3570
4234
  export declare function getFileSystemManager(): FileSystemManager;
@@ -3584,6 +4248,8 @@ export declare function getFileSystemManager(): FileSystemManager;
3584
4248
  * ```
3585
4249
  * @since 0.0.26
3586
4250
  * @contractStatus verified | Android、iOS 的入参、图片尺寸、方向、格式和路径返回结构一致
4251
+ * @containerSupport Page | supported
4252
+ * @containerSupport Widget | unsupported
3587
4253
  * @platformSupport Android | supported | 支持读取本地图片和 HTTP、HTTPS 网络图片信息
3588
4254
  * @platformSupport iOS | supported | 支持读取本地图片和 HTTP、HTTPS 网络图片信息
3589
4255
  * @platformSupport PC | unsupported | 暂不支持
@@ -3677,6 +4343,8 @@ export declare interface GetImageInfoResult {
3677
4343
  * @contractStatus verified | 文档入参与返回字段可选性已与 Android、iOS 当前实现对齐
3678
4344
  * @contractMismatch non-blocking | behavior | 授权触发方式 | Android,iOS | Android、iOS 均要求应用授权和系统定位权限 | Android 调用 getLocation 时可主动申请权限,iOS 调用 getLocation 时只检查现有权限 | 开发者需要按平台采用不同的授权调用时序 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system/location/GetLocationMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/System/AIBridgeDoubaoGetLocationMethod.swift | 对齐双端 getLocation 是否主动申请权限
3679
4345
  * @contractMismatch non-blocking | behavior | mode=1 | iOS | mode=1 表示仅设备定位 | iOS 将 mode=1 按高精度模式处理 | 同一参数在双端的定位策略不同 | flow_ios/flow_iOS/Modules/FlowApplet/Sources/AIBridge/AIBridgeFlowGetLocationMethod.swift | 补齐 iOS 仅设备定位策略,或收敛公开参数语义
4346
+ * @containerSupport Page | supported
4347
+ * @containerSupport Widget | supported
3680
4348
  * @platformSupport Android | supported | 支持获取设备当前位置
3681
4349
  * @platformSupport iOS | supported | 支持获取设备当前位置
3682
4350
  * @platformSupport PC | unsupported | 暂不支持
@@ -3698,7 +4366,19 @@ export declare interface GetImageInfoResult {
3698
4366
  * "accuracy": 15
3699
4367
  * }
3700
4368
  * ```
3701
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息提示用户检查授权和系统定位服务
4369
+ * @errorExample
4370
+ * ```json
4371
+ * {
4372
+ * "errNo": 107,
4373
+ * "errMsg": "user permission denied"
4374
+ * }
4375
+ * ```
4376
+ * @errorCode common | 102 | Android,iOS
4377
+ * @errorCode common | 116 | Android
4378
+ * @errorCode errNo | 106 | system permission denied | Android,iOS | 系统定位权限被拒绝或系统定位服务不可用 | 引导用户在系统设置中开启定位服务与权限后重试
4379
+ * @errorCode errNo | 107 | user permission denied | Android,iOS | 用户拒绝了应用位置授权(scope.userLocation) | 调用 authorize 重新发起应用授权后重试
4380
+ * @platformNote Android | 用户拒绝应用授权返回 107、系统权限被拒返回 106;定位失败等其他失败统一返回 102。
4381
+ * @platformNote iOS | 应用授权或系统权限被拒返回 107/106;其他失败(含非法 scope)统一返回 102。
3702
4382
  * @platformNote iOS | mode 为 1 时按高精度模式处理
3703
4383
  *
3704
4384
  * @public
@@ -3724,6 +4404,13 @@ export declare interface GetLocationParams {
3724
4404
  * @constraint 取值为 0、1 或 2
3725
4405
  */
3726
4406
  mode?: number;
4407
+ /**
4408
+ * 是否接受轻定位结果。轻定位会直接利用设备已有的 Wi-Fi 扫描缓存,由服务端快速计算当前位置,缩短定位耗时。
4409
+ *
4410
+ * @default false
4411
+ * @constraint 仅 Android 生效,需使用 0.0.42 及以上版本的基础库
4412
+ */
4413
+ acceptLightLocation?: boolean;
3727
4414
  /**
3728
4415
  * 超时时间,单位毫秒,默认 30000
3729
4416
  *
@@ -3779,6 +4466,8 @@ export declare interface GetLocationResponse {
3779
4466
  *
3780
4467
  * @since 0.0.26
3781
4468
  * @contractStatus verified | 返回值由当前窗口、安全区域和设备类型同步计算,与 Android、iOS 胶囊按钮布局规则一致。
4469
+ * @containerSupport Page | supported
4470
+ * @containerSupport Widget | unsupported
3782
4471
  * @platformSupport Android | supported | 支持获取菜单按钮布局信息。
3783
4472
  * @platformSupport iOS | supported | 支持获取菜单按钮布局信息。
3784
4473
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -3820,6 +4509,8 @@ export declare const getMenuButtonBoundingClientRect: () => MenuButtonBoundingCl
3820
4509
  * @contractStatus conflict | networkType 取值及 signalStrength/weakNet 的返回条件双端不一致,无法从公开类型判断实际结果
3821
4510
  * @contractMismatch blocking | return | networkType | Android,iOS | 返回 NetworkType 联合类型内的取值 | iOS 在蜂窝网络下可能返回联合类型外的 "mobile" | 依赖联合类型穷举分支的调用方会遗漏该取值 | packages/open-api/src/device/network/network.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/AIBridgeNetworkMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeNetworkMethods.swift | 统一双端网络类型取值集合
3822
4511
  * @contractMismatch non-blocking | return | signalStrength | Android,iOS | 可选返回信号强度 | 仅 Android Wi-Fi 环境返回,iOS 恒不返回 | 依赖该字段的逻辑在 iOS 或蜂窝网络下取不到值 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/AIBridgeNetworkMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeNetworkMethods.swift | 明确 signalStrength 的返回条件
4512
+ * @containerSupport Page | supported
4513
+ * @containerSupport Widget | unsupported
3823
4514
  * @platformSupport Android | supported | 支持获取网络类型
3824
4515
  * @platformSupport iOS | supported | 支持获取网络类型
3825
4516
  * @platformSupport PC | unsupported | 暂不支持
@@ -3834,7 +4525,9 @@ export declare const getMenuButtonBoundingClientRect: () => MenuButtonBoundingCl
3834
4525
  * "hasSystemProxy": false
3835
4526
  * }
3836
4527
  * ```
3837
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息重试
4528
+ * @errorCode common | 102 | Android
4529
+ * @platformNote Android | 正常场景稳定返回网络类型;失败时返回 102。
4530
+ * @platformNote iOS | 始终成功返回网络类型,无失败分支。
3838
4531
  *
3839
4532
  * @public
3840
4533
  */
@@ -3910,6 +4603,8 @@ export declare interface GetNetworkTypeResult {
3910
4603
  *
3911
4604
  * @since 0.0.28
3912
4605
  * @contractStatus verified | 公开成功返回结构与 Android、iOS 一致;失败通过 Promise reject,业务错误在错误对象的 data 字段。
4606
+ * @containerSupport Page | supported
4607
+ * @containerSupport Widget | supported
3913
4608
  * @platformSupport Android | supported | 支持拉起收银台完成订单支付。
3914
4609
  * @platformSupport iOS | supported | 支持拉起收银台完成订单支付。
3915
4610
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -3925,8 +4620,18 @@ export declare interface GetNetworkTypeResult {
3925
4620
  * "logId": "20260519xxxx"
3926
4621
  * }
3927
4622
  * ```
3928
- * @errorCode none | - | - | Android,iOS | 无稳定的顶层 errNo/errMsg;调用失败时 Promise reject,业务错误(errNo、errMsg、errLogId)在错误对象的 data 字段 | 通过 catch 捕获并读取 e.data 排查
4623
+ * @errorExample
4624
+ * ```json
4625
+ * {
4626
+ * "errNo": 114,
4627
+ * "errMsg": "operation cancelled"
4628
+ * }
4629
+ * ```
4630
+ * @errorCode common | 102 | Android,iOS
4631
+ * @errorCode common | 103 | Android,iOS
4632
+ * @errorCode errNo | 114 | operation cancelled | Android | 用户在收银台中取消了支付操作 | 用户需要时可再次调用 `getOrderPayment` 重新拉起收银台。
3929
4633
  * @platformNote Android | 需在前台可见的 Activity 中调用,应用退至后台或无有效页面时会返回失败。
4634
+ * @platformNote Android | 用户主动取消支付时返回顶层 errNo 114(operation cancelled);iOS 在该场景不返回顶层专属 errNo。
3930
4635
  *
3931
4636
  * @public
3932
4637
  */
@@ -3983,6 +4688,8 @@ export declare interface GetOrderPaymentResult {
3983
4688
  *
3984
4689
  * @since 0.0.28
3985
4690
  * @contractStatus verified | 公开成功返回结构与 Android、iOS 一致;失败通过 Promise reject,业务错误在错误对象的 data 字段。
4691
+ * @containerSupport Page | supported
4692
+ * @containerSupport Widget | supported
3986
4693
  * @platformSupport Android | supported | 支持携带签名信息拉起收银台完成订单支付。
3987
4694
  * @platformSupport iOS | supported | 支持携带签名信息拉起收银台完成订单支付。
3988
4695
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -3998,8 +4705,18 @@ export declare interface GetOrderPaymentResult {
3998
4705
  * "logId": "20260519xxxx"
3999
4706
  * }
4000
4707
  * ```
4001
- * @errorCode none | - | - | Android,iOS | 无稳定的顶层 errNo/errMsg;调用失败时 Promise reject,业务错误(errNo、errMsg、errLogId)在错误对象的 data 字段 | 通过 catch 捕获并读取 e.data 排查
4708
+ * @errorExample
4709
+ * ```json
4710
+ * {
4711
+ * "errNo": 114,
4712
+ * "errMsg": "operation cancelled"
4713
+ * }
4714
+ * ```
4715
+ * @errorCode common | 102 | Android,iOS
4716
+ * @errorCode common | 103 | Android,iOS
4717
+ * @errorCode errNo | 114 | operation cancelled | Android | 用户在收银台中取消了支付操作 | 用户需要时可再次调用 `getOrderPaymentWithSign` 重新拉起收银台。
4002
4718
  * @platformNote Android | 需在前台可见的 Activity 中调用,应用退至后台或无有效页面时会返回失败。
4719
+ * @platformNote Android | 用户主动取消支付时返回顶层 errNo 114(operation cancelled);iOS 在该场景不返回顶层专属 errNo。
4003
4720
  *
4004
4721
  * @public
4005
4722
  */
@@ -4042,39 +4759,64 @@ export declare interface GetPackageInfoResult {
4042
4759
  }
4043
4760
 
4044
4761
  /**
4045
- * 同步获取当前 package 信息。
4762
+ * 同步获取当前 package 信息,仅供 Web SDK 模拟器使用。
4763
+ *
4764
+ * @internal
4765
+ * @containerSupport Page | supported
4766
+ * @containerSupport Widget | supported
4767
+ */
4768
+ export declare const getPackageInfoSync: () => GetPackageInfoResult;
4769
+
4770
+ /**
4771
+ * 获取当前智能服务应用的性能数据。
4772
+ *
4773
+ * Entry 由客户端保存;`getEntries*()` 同步查询当前快照,observer 只接收新完成的 Entry。
4046
4774
  *
4047
- * @returns 返回当前 package 的 appId、展示名称和展示图标地址,见 {@link GetPackageInfoResult}。
4775
+ * @returns 返回可查询性能 Entry 和创建观察者的 {@link Performance}。
4048
4776
  * @example
4049
4777
  * ```typescript
4050
- * import { getPackageInfoSync } from '@doubao-dev/framework/api';
4778
+ * import { getPerformance } from '@doubao-dev/framework/api';
4051
4779
  *
4052
- * const result = getPackageInfoSync();
4780
+ * const performance = getPerformance();
4781
+ * const observer = performance.createObserver((entryList) => {
4782
+ * console.log(entryList.getEntries());
4783
+ * });
4053
4784
  *
4054
- * console.log(result.appId, result.name, result.iconSrc);
4785
+ * performance.setBufferSize(100);
4786
+ * observer.observe({ entryTypes: ['render'] });
4787
+ * console.log(performance.getEntriesByType('render'));
4788
+ * observer.disconnect();
4055
4789
  * ```
4056
4790
  *
4057
- * @since 0.0.34
4058
- * @contractStatus verified | 由智能服务运行环境同步读取,字段与公开类型一致。
4059
- * @platformSupport Android | supported | 支持同步读取当前 package 信息。
4060
- * @platformSupport iOS | supported | 支持同步读取当前 package 信息。
4791
+ * @since 0.0.42
4792
+ * @contractStatus verified | Android、iOS 均支持同步查询已记录的性能 Entry、设置缓冲区大小,并向已观察的运行时发送新完成的 Entry。
4793
+ * @containerSupport Page | supported
4794
+ * @containerSupport Widget | supported
4795
+ * @platformSupport Android | supported | 支持查询性能 Entry、设置性能缓冲区大小和创建性能观察者。
4796
+ * @platformSupport iOS | supported | 支持查询性能 Entry、设置性能缓冲区大小和创建性能观察者。
4061
4797
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
4062
4798
  * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
4063
4799
  * @permission none | - | none | Android,iOS | 无需额外权限
4064
4800
  * @precondition All | 无额外前置条件
4801
+ * @usageNote All | 仅在需要接收后续新完成的 Entry 时创建 observer;不再需要时调用 disconnect。
4065
4802
  * @resultExample
4066
4803
  * ```json
4067
- * {
4068
- * "appId": "7000000000000000000",
4069
- * "name": "示例智能服务",
4070
- * "iconSrc": "https://example.com/icon.png"
4071
- * }
4804
+ * [
4805
+ * {
4806
+ * "entryType": "render",
4807
+ * "name": "firstRender",
4808
+ * "startTime": 1730000000000,
4809
+ * "duration": 42,
4810
+ * "path": "pages/index/index",
4811
+ * "pageId": 1
4812
+ * }
4813
+ * ]
4072
4814
  * ```
4073
4815
  * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
4074
4816
  *
4075
4817
  * @public
4076
4818
  */
4077
- export declare const getPackageInfoSync: () => GetPackageInfoResult;
4819
+ export declare function getPerformance(): Performance_2;
4078
4820
 
4079
4821
  /**
4080
4822
  * 获取隐私设置状态。
@@ -4091,6 +4833,8 @@ export declare const getPackageInfoSync: () => GetPackageInfoResult;
4091
4833
  *
4092
4834
  * @since 0.0.19
4093
4835
  * @contractStatus verified | 公开定义与 Android、iOS 的成功、失败路径一致。
4836
+ * @containerSupport Page | supported
4837
+ * @containerSupport Widget | supported
4094
4838
  * @platformSupport Android | supported | 支持获取隐私协议授权状态。
4095
4839
  * @platformSupport iOS | supported | 支持获取隐私协议授权状态。
4096
4840
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -4105,7 +4849,8 @@ export declare const getPackageInfoSync: () => GetPackageInfoResult;
4105
4849
  * "needAuthorization": false
4106
4850
  * }
4107
4851
  * ```
4108
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
4852
+ * @errorCode common | 102 | Android,iOS
4853
+ * @platformNote All | 该 API 无专属错误码,失败时统一返回 102。
4109
4854
  *
4110
4855
  * @public
4111
4856
  */
@@ -4126,6 +4871,8 @@ export declare const getPrivacySetting: (params?: {} | undefined) => Promise<Pri
4126
4871
  *
4127
4872
  * @since 0.0.25
4128
4873
  * @contractStatus verified | 由前端基于 Crypto.getRandomValues 实现,入参校验与返回结构在各端一致
4874
+ * @containerSupport Page | supported
4875
+ * @containerSupport Widget | unsupported
4129
4876
  * @platformSupport Android | supported | 支持获取安全随机数
4130
4877
  * @platformSupport iOS | supported | 支持获取安全随机数
4131
4878
  * @platformSupport PC | supported | 支持获取安全随机数
@@ -4184,6 +4931,8 @@ export declare interface GetRandomValuesResult {
4184
4931
  * @since 0.0.36
4185
4932
  * @contractStatus verified | Android、iOS 均支持单例录音管理、授权、状态事件、停止结果和可选分片事件
4186
4933
  * @contractMismatch non-blocking | platform | pcm、wav 无分片录音 | Android,iOS | format 支持 aac、pcm、wav,并通过字段约束说明平台组合要求 | Android 的 pcm、wav 必须设置大于 0 的 frameSize,iOS 可在不设置 frameSize 时直接录制 pcm、wav | 不按 Android 组合要求传参时仅 Android 启动失败 | packages/open-api/src/media/record.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/media/recorder/RecorderManager.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Media/Recorder/AIBridgeRecorderManager.swift | 对齐双端无分片 pcm、wav 能力
4934
+ * @containerSupport Page | supported
4935
+ * @containerSupport Widget | unsupported
4187
4936
  * @platformSupport Android | supported | 支持 AAC 录音和带 frameSize 的 PCM/WAV 分片录音
4188
4937
  * @platformSupport iOS | supported | 支持 AAC、PCM/WAV 录音和带 frameSize 的分片录音
4189
4938
  * @platformSupport PC | unsupported | 暂不支持
@@ -4238,6 +4987,8 @@ export declare interface GetSavedFileListResult {
4238
4987
  * @since 0.0.19
4239
4988
  * @contractStatus conflict | 豆包 iOS 未注册该接口,仅 Android 可调用
4240
4989
  * @contractMismatch blocking | platform | 获取屏幕亮度 | iOS | 双端均可获取屏幕亮度 | 豆包 iOS 未注册 doubao.getScreenBrightness,仅提供 IDL 抽象类,调用直接失败 | iOS 上调用无法取得屏幕亮度 | packages/open-api/src/device/screen/get-screen-brightness.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system/GetScreenBrightnessMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/IDL/AbsGetScreenBrightnessMethodIDL.swift; ai-sdk/ios/AISDK/Sources/Core/AISDK.swift | 补齐豆包 iOS getScreenBrightness 实现与注册
4990
+ * @containerSupport Page | supported
4991
+ * @containerSupport Widget | unsupported
4241
4992
  * @platformSupport Android | supported | 支持获取屏幕亮度
4242
4993
  * @platformSupport iOS | unsupported | 豆包 iOS 未实现获取屏幕亮度接口
4243
4994
  * @platformSupport PC | unsupported | 暂不支持
@@ -4251,7 +5002,7 @@ export declare interface GetSavedFileListResult {
4251
5002
  * "value": 0.6
4252
5003
  * }
4253
5004
  * ```
4254
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | Android 根据异常信息重试,iOS 暂不支持该 API
5005
+ * @errorCode common | 102 | Android
4255
5006
  *
4256
5007
  * @public
4257
5008
  */
@@ -4282,12 +5033,15 @@ export declare interface GetScreenBrightnessResult {
4282
5033
  *
4283
5034
  * @since 0.0.36
4284
5035
  * @contractStatus verified | withSubscriptions 当前仅允许 false,Android、iOS 均支持返回授权设置。
5036
+ * @containerSupport Page | supported
5037
+ * @containerSupport Widget | supported
4285
5038
  * @platformSupport Android | supported | 支持获取用户的应用授权设置。
4286
5039
  * @platformSupport iOS | supported | 支持获取用户的应用授权设置。
4287
5040
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
4288
5041
  * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
4289
5042
  * @permission none | - | none | Android,iOS | 无需额外权限
4290
5043
  * @precondition All | 无额外前置条件
5044
+ * @usageNote All | authSetting 只表示当前智能服务的 scope 授权,不表示宿主系统权限;HealthKit 逐类型系统状态通过 getAppAuthorizeSetting 查询。
4291
5045
  * @usageNote All | authSetting 只包含已向用户请求过且状态明确的权限;豆包当前不支持订阅模板,不要传入 withSubscriptions: true。
4292
5046
  * @resultExample
4293
5047
  * ```json
@@ -4298,7 +5052,17 @@ export declare interface GetScreenBrightnessResult {
4298
5052
  * }
4299
5053
  * }
4300
5054
  * ```
4301
- * @errorCode none | - | - | Android,iOS | 传入 withSubscriptions: true 等失败当前只返回文本信息,未稳定返回顶层 errNo/errMsg | 不要传入 withSubscriptions: true
5055
+ * @errorExample
5056
+ * ```json
5057
+ * {
5058
+ * "errNo": 103,
5059
+ * "errMsg": "feature not support"
5060
+ * }
5061
+ * ```
5062
+ * @errorCode common | 102 | Android,iOS
5063
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 传入 withSubscriptions: true,豆包当前不支持订阅消息模板 | 不要传入 withSubscriptions: true,仅使用默认的 false
5064
+ * @errorCode errNo | 116 | resource not found | Android | 未找到当前应用对应的运行环境记录 | 确认应用已正确安装并在有效运行环境中调用后重试
5065
+ * @platformNote iOS | iOS 不返回 errNo 116(resource not found),相应失败场景统一以 errNo 102(internal error)返回。
4302
5066
  *
4303
5067
  * @public
4304
5068
  */
@@ -4319,7 +5083,7 @@ export declare interface GetSettingParams {
4319
5083
  export declare interface GetSettingResult {
4320
5084
  /** 用户授权结果,key 为权限 scope,value 表示是否已授权 */
4321
5085
  authSetting: AuthSetting;
4322
- /** 用户订阅消息设置,withSubscriptions 为 true 时才会返回 */
5086
+ /** 预留的订阅消息设置字段。豆包当前仅支持 `withSubscriptions: false`,因此不会返回该字段。 */
4323
5087
  subscriptionsSetting?: SubscriptionsSetting;
4324
5088
  }
4325
5089
 
@@ -4342,6 +5106,8 @@ export declare interface GetSettingResult {
4342
5106
  * @since 0.0.17
4343
5107
  * @contractStatus conflict | key 不存在时双端返回空值且判定成功,与公开必返 data 类型冲突。
4344
5108
  * @contractMismatch blocking | return | result.data | Android,iOS | data 为必返字段,类型为 TData | key 不存在时 Android 返回 null、iOS 返回 nil,且均按成功返回,不抛出错误 | 调用方按必返字段使用会得到 undefined,且无法区分「未写入」与「写入了空值」 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/storage/GetStorageMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Storage/GetStorageMethod.swift; ai-sdk/ios/AISDK/Sources/JSBridge/IDL/AbsGetStorageMethodIDL.swift | key 不存在时改为返回 keyNotFound 错误,或将公开 data 字段改为可选
5109
+ * @containerSupport Page | supported
5110
+ * @containerSupport Widget | supported
4345
5111
  * @platformSupport Android | supported | 支持按智能服务维度读取本地缓存。
4346
5112
  * @platformSupport iOS | supported | 支持按智能服务维度读取本地缓存。
4347
5113
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -4388,6 +5154,8 @@ export declare function getStorage<TData = unknown>(params: GetStorageParams): P
4388
5154
  *
4389
5155
  * @since 0.0.17
4390
5156
  * @contractStatus verified | 返回字段、单位及 Android、iOS 错误字段已核对一致。
5157
+ * @containerSupport Page | supported
5158
+ * @containerSupport Widget | supported
4391
5159
  * @platformSupport Android | supported | 支持查询当前智能服务的本地缓存信息。
4392
5160
  * @platformSupport iOS | supported | 支持查询当前智能服务的本地缓存信息。
4393
5161
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -4434,6 +5202,8 @@ export declare interface GetStorageInfoResult {
4434
5202
  *
4435
5203
  * @since 0.0.19
4436
5204
  * @contractStatus verified | 返回字段、单位及 Android、iOS 错误字段已核对一致。
5205
+ * @containerSupport Page | supported
5206
+ * @containerSupport Widget | supported
4437
5207
  * @platformSupport Android | supported | 支持同步查询当前智能服务的本地缓存信息。
4438
5208
  * @platformSupport iOS | supported | 支持同步查询当前智能服务的本地缓存信息。
4439
5209
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -4486,6 +5256,8 @@ export declare interface GetStorageResult<TData = unknown> {
4486
5256
  * @since 0.0.19
4487
5257
  * @contractStatus conflict | key 不存在时双端返回空值且判定成功,与公开必返 data 类型冲突。
4488
5258
  * @contractMismatch blocking | return | result.data | Android,iOS | data 为必返字段,类型为 TData | key 不存在时 Android 返回 null、iOS 返回 nil,且均按成功返回,不抛出错误 | 调用方按必返字段使用会得到 undefined,且无法区分「未写入」与「写入了空值」 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/storage/GetStorageMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Storage/GetStorageMethod.swift; ai-sdk/ios/AISDK/Sources/JSBridge/IDL/AbsGetStorageMethodIDL.swift | key 不存在时改为返回 keyNotFound 错误,或将公开 data 字段改为可选
5259
+ * @containerSupport Page | supported
5260
+ * @containerSupport Widget | supported
4489
5261
  * @platformSupport Android | supported | 支持按智能服务维度同步读取本地缓存。
4490
5262
  * @platformSupport iOS | supported | 支持按智能服务维度同步读取本地缓存。
4491
5263
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -4520,7 +5292,7 @@ export declare function getStorageSync<TData = unknown>(params: GetStorageParams
4520
5292
  /**
4521
5293
  * 获取系统信息。
4522
5294
  *
4523
- * @returns 返回设备品牌、型号、屏幕尺寸、宿主信息和安全区域等字段,见 {@link GetSystemInfoResult}。
5295
+ * @returns 返回设备品牌、型号、屏幕尺寸、豆包客户端信息和安全区域等字段,见 {@link GetSystemInfoResult}。
4524
5296
  * @example
4525
5297
  * ```typescript
4526
5298
  * import { getSystemInfo } from '@doubao-dev/framework/api';
@@ -4533,7 +5305,9 @@ export declare function getStorageSync<TData = unknown>(params: GetStorageParams
4533
5305
  *
4534
5306
  * @since 0.0.34
4535
5307
  * @contractStatus verified | 设备品牌、屏幕尺寸、系统信息和安全区域等字段与公开类型一致。
4536
- * @contractMismatch non-blocking | return | abi | Android,iOS | abi 为可选字段,返回宿主 App 二进制接口类型 | Android 返回具体 abi,iOS 不返回该字段 | 依赖 abi 的逻辑仅在 Android 生效 | packages/open-api/src/basic/system/system.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system/GetSystemInfoMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/System | 明确 abi 为 Android 专属字段,或补齐 iOS 对应字段
5308
+ * @contractMismatch non-blocking | return | abi | Android,iOS | abi 为可选字段,返回豆包客户端二进制接口类型 | Android 返回具体 abi,iOS 不返回该字段 | 依赖 abi 的逻辑仅在 Android 生效 | packages/open-api/src/basic/system/system.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system/GetSystemInfoMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/System | 明确 abi 为 Android 专属字段,或补齐 iOS 对应字段
5309
+ * @containerSupport Page | supported
5310
+ * @containerSupport Widget | supported
4537
5311
  * @platformSupport Android | supported | 支持获取系统信息。
4538
5312
  * @platformSupport iOS | supported | 支持获取系统信息。
4539
5313
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -4572,7 +5346,7 @@ export declare function getStorageSync<TData = unknown>(params: GetStorageParams
4572
5346
  * }
4573
5347
  * ```
4574
5348
  * @errorCode common | 102 | Android
4575
- * @platformNote Android | abi 返回宿主 App 二进制接口类型(如 arm64-v8a),iOS 不返回该字段
5349
+ * @platformNote Android | abi 返回豆包客户端二进制接口类型(如 arm64-v8a),iOS 不返回该字段
4576
5350
  *
4577
5351
  * @public
4578
5352
  */
@@ -4598,7 +5372,7 @@ export declare interface GetSystemInfoResult {
4598
5372
  statusBarHeight: number;
4599
5373
  /** 系统语言,格式为 language_region,如 zh_CN、en_US */
4600
5374
  language: string;
4601
- /** 宿主版本号 */
5375
+ /** 豆包客户端版本号 */
4602
5376
  version?: string;
4603
5377
  /** 操作系统及版本,如 "Android 14"、"iOS 17.5" */
4604
5378
  system: string;
@@ -4616,14 +5390,14 @@ export declare interface GetSystemInfoResult {
4616
5390
  enableDebug?: boolean;
4617
5391
  /** 设备方向 */
4618
5392
  deviceOrientation?: 'portrait' | 'landscape';
4619
- /** 宿主 App 二进制接口类型(如 arm64-v8a),仅 Android 返回 */
5393
+ /** 豆包客户端二进制接口类型(如 arm64-v8a),仅 Android 返回 */
4620
5394
  abi?: string;
4621
5395
  }
4622
5396
 
4623
5397
  /**
4624
5398
  * 同步获取系统信息。
4625
5399
  *
4626
- * @returns 返回设备品牌、型号、屏幕尺寸、宿主信息和安全区域等字段,见 {@link GetSystemInfoResult}。
5400
+ * @returns 返回设备品牌、型号、屏幕尺寸、豆包客户端信息和安全区域等字段,见 {@link GetSystemInfoResult}。
4627
5401
  * @example
4628
5402
  * ```typescript
4629
5403
  * import { getSystemInfoSync } from '@doubao-dev/framework/api';
@@ -4636,7 +5410,9 @@ export declare interface GetSystemInfoResult {
4636
5410
  *
4637
5411
  * @since 0.0.34
4638
5412
  * @contractStatus verified | 设备品牌、屏幕尺寸、系统信息和安全区域等字段与公开类型一致。
4639
- * @contractMismatch non-blocking | return | abi | Android,iOS | abi 为可选字段,返回宿主 App 二进制接口类型 | Android 返回具体 abi,iOS 不返回该字段 | 依赖 abi 的逻辑仅在 Android 生效 | packages/open-api/src/basic/system/system.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system/GetSystemInfoMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/System | 明确 abi 为 Android 专属字段,或补齐 iOS 对应字段
5413
+ * @contractMismatch non-blocking | return | abi | Android,iOS | abi 为可选字段,返回豆包客户端二进制接口类型 | Android 返回具体 abi,iOS 不返回该字段 | 依赖 abi 的逻辑仅在 Android 生效 | packages/open-api/src/basic/system/system.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system/GetSystemInfoMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/System | 明确 abi 为 Android 专属字段,或补齐 iOS 对应字段
5414
+ * @containerSupport Page | supported
5415
+ * @containerSupport Widget | supported
4640
5416
  * @platformSupport Android | supported | 支持同步获取系统信息。
4641
5417
  * @platformSupport iOS | supported | 支持同步获取系统信息。
4642
5418
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -4675,7 +5451,7 @@ export declare interface GetSystemInfoResult {
4675
5451
  * }
4676
5452
  * ```
4677
5453
  * @errorCode common | 102 | Android
4678
- * @platformNote Android | abi 返回宿主 App 二进制接口类型(如 arm64-v8a),iOS 不返回该字段
5454
+ * @platformNote Android | abi 返回豆包客户端二进制接口类型(如 arm64-v8a),iOS 不返回该字段
4679
5455
  *
4680
5456
  * @public
4681
5457
  */
@@ -4698,6 +5474,8 @@ export declare const getSystemInfoSync: (_params?: {}) => GetSystemInfoResult;
4698
5474
  * @since 0.0.25
4699
5475
  * @contractStatus verified | 蓝牙、定位、Wi-Fi 和设备方向字段与公开类型一致,均可稳定返回。
4700
5476
  * @contractMismatch non-blocking | return | wifiEnabled | Android,iOS | wifiEnabled 表示 Wi-Fi 系统开关状态 | Android 返回系统 Wi-Fi 开关是否打开,iOS 返回当前是否正在通过 Wi-Fi 联网 | 双端 wifiEnabled 语义不同,但不会破坏公开类型 | packages/open-api/src/basic/system/system.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system/GetSystemSettingMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/System | 统一双端 wifiEnabled 语义,或在公开字段说明中固定其中一种
5477
+ * @containerSupport Page | supported
5478
+ * @containerSupport Widget | supported
4701
5479
  * @platformSupport Android | supported | 支持获取设备系统设置。
4702
5480
  * @platformSupport iOS | supported | 支持获取设备系统设置。
4703
5481
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -4713,7 +5491,7 @@ export declare const getSystemInfoSync: (_params?: {}) => GetSystemInfoResult;
4713
5491
  * "deviceOrientation": "portrait"
4714
5492
  * }
4715
5493
  * ```
4716
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
5494
+ * @errorCode common | 102 | Android
4717
5495
  * @platformNote Android | wifiEnabled 表示系统 Wi-Fi 开关是否打开
4718
5496
  * @platformNote iOS | wifiEnabled 表示当前是否正在通过 Wi-Fi 联网
4719
5497
  *
@@ -4751,6 +5529,8 @@ export declare interface GetSystemSettingResult {
4751
5529
  * @since 0.0.25
4752
5530
  * @contractStatus conflict | 双端均可调用,但 Android 返回扫描到的周边 Wi-Fi,iOS 仅返回当前连接
4753
5531
  * @contractMismatch blocking | behavior | 扫描范围 | iOS | 返回周边可用的 Wi-Fi 列表 | 豆包 iOS 无系统扫描能力,仅返回当前已连接的一条 Wi-Fi | iOS 上无法列出周边 Wi-Fi,列表最多一条 | packages/open-api/src/device/wifi/wifi.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/wifi/WifiInfoReader.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/Wifi/AIBridgeWifiManager.swift | 记录 iOS 无法扫描周边 Wi-Fi
5532
+ * @containerSupport Page | supported
5533
+ * @containerSupport Widget | unsupported
4754
5534
  * @platformSupport Android | supported | 支持扫描并返回周边 Wi-Fi 列表
4755
5535
  * @platformSupport iOS | supported | 仅返回当前已连接的 Wi-Fi
4756
5536
  * @platformSupport PC | unsupported | 暂不支持
@@ -4775,7 +5555,26 @@ export declare interface GetSystemSettingResult {
4775
5555
  * ]
4776
5556
  * }
4777
5557
  * ```
4778
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据返回的错误信息(如未初始化、无权限)提示用户
5558
+ * @errorExample
5559
+ * ```json
5560
+ * {
5561
+ * "errNo": 1401001,
5562
+ * "errMsg": "wifi is not initialized"
5563
+ * }
5564
+ * ```
5565
+ * @errorCode common | 102 | Android,iOS
5566
+ * @errorCode errNo | 1401001 | wifi is not initialized | Android,iOS | 调用前未先调用 startWifi 完成初始化 | 先调用 startWifi 再获取 Wi-Fi 列表
5567
+ * @errorCode errNo | 1401002 | wifi is not connected | iOS | iOS 仅返回当前已连接 Wi-Fi,当前未连接时读取失败 | 确认设备已连接 Wi-Fi 后重试
5568
+ * @errorCode errNo | 106 | system permission denied | iOS | 系统定位服务未开启,无法读取 Wi-Fi 信息 | 引导用户在系统设置中开启定位服务
5569
+ * @errorCode errNo | 107 | user permission denied | iOS | 用户未授予定位权限或未开启精确定位 | 引导用户授予定位权限并开启精确定位
5570
+ * @errorCode errNo | 114 | operation cancelled | iOS | 用户取消了位置权限授权弹窗 | 用户需要时可再次触发授权后重试
5571
+ * @errorCode errNo | 301 | network request cancelled | iOS | 位置授权过程中的网络请求被取消 | 确认应用和网络状态后重试
5572
+ * @errorCode errNo | 302 | connection timed out | iOS | 位置授权过程中的网络连接超时 | 检查网络连接后重试
5573
+ * @errorCode errNo | 303 | no network connection | iOS | 当前无可用网络连接 | 恢复网络连接后重试
5574
+ * @errorCode errNo | 305 | network failure | iOS | 位置授权过程中发生其他网络错误 | 检查网络连接,稍后重试
5575
+ * @errorCode errNo | 112 | invalid result | iOS | 位置授权服务返回的数据无法解析 | 稍后重试;持续失败时反馈服务端响应异常
5576
+ * @platformNote Android | 未初始化返回 1401001;扫描列表为空不视为失败;因定位权限不足导致读取失败时返回 102。
5577
+ * @platformNote iOS | 仅返回当前已连接 Wi-Fi,未连接返回 1401002;读取前会发起位置权限授权,可返回 106/107 及授权网络类失败(301/302/303/305/112)。
4779
5578
  *
4780
5579
  * @public
4781
5580
  */
@@ -4807,6 +5606,8 @@ export declare interface GetWifiListResult {
4807
5606
  *
4808
5607
  * @since 0.0.18
4809
5608
  * @contractStatus verified | 窗口信息由智能服务运行环境读取,字段与公开类型一致。
5609
+ * @containerSupport Page | supported
5610
+ * @containerSupport Widget | unsupported
4810
5611
  * @platformSupport Android | supported | 支持获取窗口信息。
4811
5612
  * @platformSupport iOS | supported | 支持获取窗口信息。
4812
5613
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -4876,6 +5677,8 @@ export declare interface GetWindowInfoResult {
4876
5677
  *
4877
5678
  * @since 0.0.18
4878
5679
  * @contractStatus verified | 窗口信息由智能服务运行环境同步读取,字段与公开类型一致。
5680
+ * @containerSupport Page | supported
5681
+ * @containerSupport Widget | unsupported
4879
5682
  * @platformSupport Android | supported | 支持同步获取窗口信息。
4880
5683
  * @platformSupport iOS | supported | 支持同步获取窗口信息。
4881
5684
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -4931,6 +5734,40 @@ export declare interface GyroscopeChangeEvent {
4931
5734
  */
4932
5735
  export declare type GyroscopeChangeListener = (event: GyroscopeChangeEvent) => void;
4933
5736
 
5737
+ /** @public */
5738
+ export declare interface HealthDataAuthorizationDetail {
5739
+ /** iOS SDK 支持的全部健康类型及其读取状态。 */
5740
+ readStatus: HealthDataAuthorizationItem[];
5741
+ }
5742
+
5743
+ /** @public */
5744
+ export declare interface HealthDataAuthorizationItem {
5745
+ /** 健康数据类型。 */
5746
+ type: HealthDataType_2;
5747
+ /** 当前类型的读取权限状态码。 */
5748
+ status: HealthDataAuthorizationStatus;
5749
+ }
5750
+
5751
+ /**
5752
+ * HealthKit 读取权限状态码。
5753
+ *
5754
+ * - `-1`:未知或当前系统不支持该类型
5755
+ * - `0`:系统仍需要展示授权请求
5756
+ * - `1`:轻量查询推断为已拒绝
5757
+ * - `2`:轻量查询未发现授权错误
5758
+ *
5759
+ * @public
5760
+ */
5761
+ export declare type HealthDataAuthorizationStatus = -1 | 0 | 1 | 2;
5762
+
5763
+ /** @public */
5764
+ export declare interface HealthDataAuthorizeOptions {
5765
+ /** 健康数据类型列表;用于申请对应的 HealthKit 读取权限。 */
5766
+ types: HealthDataType[];
5767
+ }
5768
+
5769
+ export declare type HealthDataType = HealthDataType_2;
5770
+
4934
5771
  /**
4935
5772
  * 隐藏交互提示框的公共参数。
4936
5773
  *
@@ -4951,6 +5788,8 @@ export declare interface HideInteractionParams {
4951
5788
  *
4952
5789
  * @since 0.0.25
4953
5790
  * @contractStatus verified | 无返回字段,与 Android、iOS 实现一致。
5791
+ * @containerSupport Page | supported
5792
+ * @containerSupport Widget | unsupported
4954
5793
  * @platformSupport Android | supported | 支持收起当前键盘。
4955
5794
  * @platformSupport iOS | supported | 支持收起当前键盘。
4956
5795
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -4980,6 +5819,8 @@ export declare interface HideKeyboardParam {
4980
5819
  *
4981
5820
  * @since 0.0.26
4982
5821
  * @contractStatus verified | 无参数、无返回字段,与 Android、iOS 实现一致。
5822
+ * @containerSupport Page | supported
5823
+ * @containerSupport Widget | unsupported
4983
5824
  * @platformSupport Android | supported | 支持隐藏当前 loading。
4984
5825
  * @platformSupport iOS | supported | 支持隐藏当前 loading。
4985
5826
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -5005,6 +5846,8 @@ export declare const hideLoading: (params?: HideInteractionParams | undefined) =
5005
5846
  *
5006
5847
  * @since 0.0.26
5007
5848
  * @contractStatus verified | 无参数、无返回字段,与 Android、iOS 实现一致。
5849
+ * @containerSupport Page | supported
5850
+ * @containerSupport Widget | supported
5008
5851
  * @platformSupport Android | supported | 支持隐藏当前 Toast。
5009
5852
  * @platformSupport iOS | supported | 支持隐藏当前 Toast。
5010
5853
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -5149,6 +5992,8 @@ export declare interface InnerAudioError {
5149
5992
  * @since 0.0.25
5150
5993
  * @contractStatus conflict | 豆包 iOS 未提供查询配对状态能力,仅 Android 可调用
5151
5994
  * @contractMismatch blocking | platform | 查询配对状态 | iOS | 双端均可查询设备配对状态 | 豆包 iOS 的 isBluetoothDevicePaired 固定返回不支持 | iOS 上调用无法查询设备是否已配对 | packages/open-api/src/device/bluetooth/bluetooth.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/IsBluetoothDevicePairedMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeDeviceBluetoothMethods.swift | 补齐豆包 iOS 查询配对状态能力
5995
+ * @containerSupport Page | supported
5996
+ * @containerSupport Widget | unsupported
5152
5997
  * @platformSupport Android | supported | 支持查询设备配对状态
5153
5998
  * @platformSupport iOS | unsupported | 豆包 iOS 未实现查询配对状态,调用返回不支持
5154
5999
  * @platformSupport PC | unsupported | 暂不支持
@@ -5209,6 +6054,19 @@ export declare interface KeyboardHeightChangeEvent {
5209
6054
  /** @public */
5210
6055
  export declare type KeyboardHeightChangeListener = (event: KeyboardHeightChangeEvent) => void;
5211
6056
 
6057
+ /**
6058
+ * 定位精细授权状态。
6059
+ *
6060
+ * 继承 {@link UnauthorizedDetail} 的全部取值;获得权限时返回:
6061
+ * - `foreground approximate`:仅应用在前台时可以获取模糊定位。
6062
+ * - `foreground precise`:仅应用在前台时可以获取精确定位。
6063
+ * - `background approximate`:应用在前台或后台时均可以获取模糊定位。
6064
+ * - `background precise`:应用在前台或后台时均可以获取精确定位。
6065
+ *
6066
+ * @public
6067
+ */
6068
+ export declare type LocationAuthorizationDetail = UnauthorizedDetail | 'foreground approximate' | 'foreground precise' | 'background approximate' | 'background precise';
6069
+
5212
6070
  /** @public */
5213
6071
  export declare interface LocationChangeErrorEvent {
5214
6072
  /**
@@ -5291,6 +6149,8 @@ export declare type LocationOperationResult = Record<string, never>;
5291
6149
  *
5292
6150
  * @since 0.0.19
5293
6151
  * @contractStatus verified | 公开参数、超时语义、返回结构及 Android、iOS 错误字段已核对一致。
6152
+ * @containerSupport Page | supported
6153
+ * @containerSupport Widget | supported
5294
6154
  * @platformSupport Android | supported | 支持获取当前智能服务的一次性登录凭证。
5295
6155
  * @platformSupport iOS | supported | 支持获取当前智能服务的一次性登录凭证。
5296
6156
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -5405,6 +6265,8 @@ export declare const LoginType: {
5405
6265
  * @since 0.0.19
5406
6266
  * @contractStatus conflict | loginType 的四个枚举语义未在 Android、iOS 完整实现。
5407
6267
  * @contractMismatch blocking | parameter | params.loginType | Android,iOS | 通过 0/1/2/3 分别指定隐私登录、仅登录、先登录再隐私(两次弹窗)、登录与隐私合并(一次弹窗) | Android 仅区分 0(隐私流程)与非 0(登录流程),iOS 按当前隐私授权状态路由、仅记录 loginType 不据其分流,两次弹窗与合并弹窗语义均未生效 | 调用方无法通过 loginType 精确控制弹窗形态 | packages/open-api/src/open/login/login-with-doubao-widget.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/login/LoginWithDoubaoWidgetMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Auth/AppletPageLoginManager.swift | 明确 loginType 各枚举的双端一致行为或收敛可选值
6268
+ * @containerSupport Page | supported
6269
+ * @containerSupport Widget | supported
5408
6270
  * @platformSupport Android | supported | 支持拉起豆包登录或隐私授权流程。
5409
6271
  * @platformSupport iOS | supported | 支持拉起豆包登录或隐私授权流程。
5410
6272
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -5419,7 +6281,17 @@ export declare const LoginType: {
5419
6281
  * "result": true
5420
6282
  * }
5421
6283
  * ```
5422
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
6284
+ * @errorExample
6285
+ * ```json
6286
+ * {
6287
+ * "errNo": 112,
6288
+ * "errMsg": "invalid result"
6289
+ * }
6290
+ * ```
6291
+ * @errorCode common | 102 | Android,iOS
6292
+ * @errorCode errNo | 112 | invalid result | Android | 登录或隐私状态查询成功但返回数据缺失(如缺少隐私卡片或手机掩码) | 稍后重试;持续失败时反馈服务端响应异常。
6293
+ * @platformNote Android | 状态查询成功但关键数据缺失返回 112;其他失败统一返回 102。
6294
+ * @platformNote iOS | 失败统一返回 102。
5423
6295
  *
5424
6296
  * @public
5425
6297
  */
@@ -5460,6 +6332,8 @@ export declare interface LoginWithWidgetResult {
5460
6332
  * @since 0.0.25
5461
6333
  * @contractStatus conflict | 豆包 iOS 未提供蓝牙配对能力,仅 Android 可调用
5462
6334
  * @contractMismatch blocking | platform | 蓝牙配对 | iOS | 双端均可发起蓝牙配对 | 豆包 iOS 的 makeBluetoothPair 固定返回不支持 | iOS 上调用无法发起蓝牙配对 | packages/open-api/src/device/bluetooth/bluetooth.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/MakeBluetoothPairMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeDeviceBluetoothMethods.swift | 补齐豆包 iOS 蓝牙配对能力
6335
+ * @containerSupport Page | supported
6336
+ * @containerSupport Widget | unsupported
5463
6337
  * @platformSupport Android | supported | 支持发起蓝牙配对
5464
6338
  * @platformSupport iOS | unsupported | 豆包 iOS 未实现蓝牙配对,调用返回不支持
5465
6339
  * @platformSupport PC | unsupported | 暂不支持
@@ -5517,6 +6391,8 @@ export declare interface MakeBluetoothPairParams {
5517
6391
  * @since 0.0.19
5518
6392
  * @contractStatus conflict | 拨号成功语义双端不一致
5519
6393
  * @contractMismatch blocking | behavior | 拨号成功语义 | Android,iOS | 唤起系统拨号并返回成功 | Android 通过 ACTION_DIAL 打开拨号盘即成功,iOS 通过 open(tel:) 唤起,是否进入拨号盘取决于系统处理结果 | 相同调用在双端"成功"代表的实际状态不同 | packages/open-api/src/device/phone/phone.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/AIBridgePhoneMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgePhoneMethods.swift | 统一双端拨号成功语义
6394
+ * @containerSupport Page | supported
6395
+ * @containerSupport Widget | supported
5520
6396
  * @platformSupport Android | supported | 支持唤起系统拨号
5521
6397
  * @platformSupport iOS | supported | 支持唤起系统拨号
5522
6398
  * @platformSupport PC | unsupported | 暂不支持
@@ -5528,7 +6404,16 @@ export declare interface MakeBluetoothPairParams {
5528
6404
  * ```json
5529
6405
  * {}
5530
6406
  * ```
5531
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认设备是否支持拨号
6407
+ * @errorExample
6408
+ * ```json
6409
+ * {
6410
+ * "errNo": 104,
6411
+ * "errMsg": "invalid parameter"
6412
+ * }
6413
+ * ```
6414
+ * @errorCode common | 102 | Android,iOS
6415
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | phoneNumber 为空,或在 iOS 上无法拼接为有效的拨号 URL | 传入合法的电话号码后重试。
6416
+ * @errorCode errNo | 103 | feature not support | iOS | 当前设备不支持拨打电话 | 在支持拨号的设备上调用,或提前提示用户设备不支持拨号。
5532
6417
  *
5533
6418
  * @public
5534
6419
  */
@@ -5560,6 +6445,13 @@ export declare interface MenuButtonBoundingClientRect {
5560
6445
  left: number;
5561
6446
  }
5562
6447
 
6448
+ /**
6449
+ * 麦克风精细授权状态,取值与 {@link BasicAuthorizationDetail} 一致。
6450
+ *
6451
+ * @public
6452
+ */
6453
+ export declare type MicrophoneAuthorizationDetail = BasicAuthorizationDetail;
6454
+
5563
6455
  /**
5564
6456
  * {@link FileSystemManager.mkdir} 的参数。
5565
6457
  *
@@ -5594,6 +6486,8 @@ export declare interface MkdirParams {
5594
6486
  *
5595
6487
  * @since 0.0.19
5596
6488
  * @contractStatus verified | 公开参数、返回语义及 Android、iOS 失败字段已核对一致。
6489
+ * @containerSupport Page | supported
6490
+ * @containerSupport Widget | unsupported
5597
6491
  * @platformSupport Android | supported | 支持在页面栈内返回指定层数。
5598
6492
  * @platformSupport iOS | supported | 支持在页面栈内返回指定层数。
5599
6493
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -5601,7 +6495,7 @@ export declare interface MkdirParams {
5601
6495
  * @permission none | - | none | Android,iOS | 无需额外权限
5602
6496
  * @precondition All | 无额外前置条件
5603
6497
  * @usageNote All | navigateBack 只能在页面栈内返回;当前页面已是页面栈中的最后一个页面时无法继续返回,需要退出智能服务请调用 exitApp。
5604
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
6498
+ * @errorCode common | 102 | Android,iOS
5605
6499
  *
5606
6500
  * @public
5607
6501
  */
@@ -5631,6 +6525,8 @@ export declare interface NavigateBackParams {
5631
6525
  *
5632
6526
  * @since 0.0.19
5633
6527
  * @contractStatus verified | 公开参数、跳转语义及 Android、iOS 失败字段已核对一致。
6528
+ * @containerSupport Page | supported
6529
+ * @containerSupport Widget | supported
5634
6530
  * @platformSupport Android | supported | 支持在当前智能服务内跳转到指定页面。
5635
6531
  * @platformSupport iOS | supported | 支持在当前智能服务内跳转到指定页面。
5636
6532
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -5638,7 +6534,15 @@ export declare interface NavigateBackParams {
5638
6534
  * @permission none | - | none | Android,iOS | 无需额外权限
5639
6535
  * @precondition All | 无额外前置条件
5640
6536
  * @usageNote All | url 为智能服务内的页面路径,可携带查询参数;跳转后当前页面会保留在页面栈中,可通过 navigateBack 返回。
5641
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
6537
+ * @errorExample
6538
+ * ```json
6539
+ * {
6540
+ * "errNo": 104,
6541
+ * "errMsg": "invalid url"
6542
+ * }
6543
+ * ```
6544
+ * @errorCode common | 102 | Android,iOS
6545
+ * @errorCode errNo | 104 | invalid url | Android,iOS | url 为空或无法解析为有效的智能服务页面路径 | 检查 url 是否为合法的应用内页面路径后重试。
5642
6546
  *
5643
6547
  * @public
5644
6548
  */
@@ -5684,6 +6588,16 @@ export declare type NetworkStatusChangeListener = (event: NetworkStatusChangeEve
5684
6588
  */
5685
6589
  export declare type NetworkType = 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown' | 'none';
5686
6590
 
6591
+ /**
6592
+ * 通知精细授权状态。
6593
+ *
6594
+ * 继承 {@link BasicAuthorizationDetail} 的全部取值,并增加:
6595
+ * - `provisional`:iOS 临时静默授权;不会弹出授权框,通知只进入通知中心。
6596
+ *
6597
+ * @public
6598
+ */
6599
+ export declare type NotificationAuthorizationDetail = BasicAuthorizationDetail | 'provisional';
6600
+
5687
6601
  /**
5688
6602
  * 订阅 BLE 特征值变化。
5689
6603
  *
@@ -5704,6 +6618,8 @@ export declare type NetworkType = 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown'
5704
6618
  * @returns 不包含字段的结果对象。
5705
6619
  * @since 0.0.25
5706
6620
  * @contractStatus verified | 订阅特征值变化的入参与返回结构已与 Android、iOS 当前实现对齐
6621
+ * @containerSupport Page | supported
6622
+ * @containerSupport Widget | unsupported
5707
6623
  * @platformSupport Android | supported | 支持订阅 BLE 特征值变化
5708
6624
  * @platformSupport iOS | supported | 支持订阅 BLE 特征值变化
5709
6625
  * @platformSupport PC | unsupported | 暂不支持
@@ -5764,6 +6680,8 @@ export declare interface NotifyBLECharacteristicValueChangeParams {
5764
6680
  * ```
5765
6681
  * @since 0.0.27
5766
6682
  * @contractStatus verified | 加速度事件的字段类型与必返性已与 Android、iOS 当前实现对齐
6683
+ * @containerSupport Page | supported
6684
+ * @containerSupport Widget | unsupported
5767
6685
  * @platformSupport Android | supported | 支持监听加速度数据变化
5768
6686
  * @platformSupport iOS | supported | 支持监听加速度数据变化
5769
6687
  * @platformSupport PC | unsupported | 暂不支持
@@ -5803,6 +6721,8 @@ export declare const onAccelerometerChange: ClientEventRegistry<AccelerometerCha
5803
6721
  * ```
5804
6722
  * @since 0.0.25
5805
6723
  * @contractStatus verified | 省电模式变化事件的 isLowPowerModeEnabled 字段类型与必返性已与 Android、iOS 当前实现对齐
6724
+ * @containerSupport Page | supported
6725
+ * @containerSupport Widget | unsupported
5806
6726
  * @platformSupport Android | supported | 支持监听省电模式变化
5807
6727
  * @platformSupport iOS | supported | 支持监听省电模式变化
5808
6728
  * @platformSupport PC | unsupported | 暂不支持
@@ -5843,6 +6763,8 @@ export declare const onBatteryInfoChange: ClientEventRegistry<BatteryInfoChangeE
5843
6763
  *
5844
6764
  * @since 0.0.36
5845
6765
  * @contractStatus verified | BLE 特征值变化事件的结构已与 Android、iOS 当前实现对齐;value 由框架统一解码为 ArrayBuffer
6766
+ * @containerSupport Page | supported
6767
+ * @containerSupport Widget | unsupported
5846
6768
  * @platformSupport Android | supported | 支持监听 BLE 特征值变化
5847
6769
  * @platformSupport iOS | supported | 支持监听 BLE 特征值变化
5848
6770
  * @platformSupport PC | unsupported | 暂不支持
@@ -5883,6 +6805,8 @@ export declare function onBLECharacteristicValueChange(callback: BLECharacterist
5883
6805
  *
5884
6806
  * @since 0.0.36
5885
6807
  * @contractStatus verified | BLE 连接状态变化事件的结构已与 Android、iOS 当前实现对齐
6808
+ * @containerSupport Page | supported
6809
+ * @containerSupport Widget | unsupported
5886
6810
  * @platformSupport Android | supported | 支持监听 BLE 连接状态变化
5887
6811
  * @platformSupport iOS | supported | 支持监听 BLE 连接状态变化
5888
6812
  * @platformSupport PC | unsupported | 暂不支持
@@ -5922,6 +6846,8 @@ export declare const onBLEConnectionStateChange: ClientEventRegistry<BLEConnecti
5922
6846
  *
5923
6847
  * @since 0.0.36
5924
6848
  * @contractStatus verified | 蓝牙适配器状态变化事件的结构已与 Android、iOS 当前实现对齐
6849
+ * @containerSupport Page | supported
6850
+ * @containerSupport Widget | unsupported
5925
6851
  * @platformSupport Android | supported | 支持监听蓝牙适配器状态变化
5926
6852
  * @platformSupport iOS | supported | 支持监听蓝牙适配器状态变化
5927
6853
  * @platformSupport PC | unsupported | 暂不支持
@@ -5961,6 +6887,8 @@ export declare const onBluetoothAdapterStateChange: ClientEventRegistry<GetBluet
5961
6887
  *
5962
6888
  * @since 0.0.36
5963
6889
  * @contractStatus verified | 发现蓝牙设备事件的结构已与 Android、iOS 当前实现对齐;广播二进制字段由框架统一解码为 ArrayBuffer
6890
+ * @containerSupport Page | supported
6891
+ * @containerSupport Widget | unsupported
5964
6892
  * @platformSupport Android | supported | 支持监听发现蓝牙设备
5965
6893
  * @platformSupport iOS | supported | 支持监听发现蓝牙设备
5966
6894
  * @platformSupport PC | unsupported | 暂不支持
@@ -5988,6 +6916,45 @@ export declare const onBluetoothAdapterStateChange: ClientEventRegistry<GetBluet
5988
6916
  */
5989
6917
  export declare function onBluetoothDeviceFound(callback: BluetoothDeviceFoundListener): () => void;
5990
6918
 
6919
+ /**
6920
+ * 监听对话框高度或展示状态变化。
6921
+ *
6922
+ * 注册后不会立即回调当前值。需要当前状态时,先调用 {@link getChatPanelInfo}。
6923
+ *
6924
+ * @example
6925
+ * ```typescript
6926
+ * import { onChatPanelHeightChanged } from '@doubao-dev/framework/api';
6927
+ *
6928
+ * const off = onChatPanelHeightChanged(({ height, state }) => {
6929
+ * console.log('chat panel changed', { height, state });
6930
+ * });
6931
+ *
6932
+ * off();
6933
+ * ```
6934
+ * @since 0.0.42
6935
+ * @contractStatus verified | 事件字段、状态枚举和触发语义与对话框高度变化协议一致。
6936
+ * @containerSupport Page | supported
6937
+ * @containerSupport Widget | unsupported
6938
+ * @platformSupport Android | supported | 支持监听对话框高度或展示状态变化。
6939
+ * @platformSupport iOS | supported | 支持监听对话框高度或展示状态变化。
6940
+ * @platformSupport PC | unsupported | 当前未提供该平台实现。
6941
+ * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
6942
+ * @permission none | - | none | Android,iOS | 无需额外权限
6943
+ * @precondition All | 当前页面需在 app.config.ts 中声明 chat.enabled 为 true
6944
+ * @usageNote All | 注册后不立即回调当前值;页面卸载前调用返回的取消函数。
6945
+ * @resultExample
6946
+ * ```json
6947
+ * {
6948
+ * "height": 336,
6949
+ * "state": "expanded"
6950
+ * }
6951
+ * ```
6952
+ * @errorCode none | - | - | Android,iOS | 事件无错误码 | 无需处理
6953
+ *
6954
+ * @public
6955
+ */
6956
+ export declare const onChatPanelHeightChanged: ClientEventRegistry<ChatPanelInfo>;
6957
+
5991
6958
  /**
5992
6959
  * 监听罗盘数据变化事件。
5993
6960
  *
@@ -6005,6 +6972,8 @@ export declare function onBluetoothDeviceFound(callback: BluetoothDeviceFoundLis
6005
6972
  * ```
6006
6973
  * @since 0.0.26
6007
6974
  * @contractStatus verified | 罗盘事件的 direction 字段类型与必返性已与 Android、iOS 当前实现对齐
6975
+ * @containerSupport Page | supported
6976
+ * @containerSupport Widget | unsupported
6008
6977
  * @platformSupport Android | supported | 支持监听罗盘数据变化
6009
6978
  * @platformSupport iOS | supported | 支持监听罗盘数据变化
6010
6979
  * @platformSupport PC | unsupported | 暂不支持
@@ -6041,6 +7010,8 @@ export declare const onCompassChange: ClientEventRegistry<CompassChangeEvent>;
6041
7010
  * ```
6042
7011
  * @since 0.0.29
6043
7012
  * @contractStatus verified | 设备方向事件的字段类型与必返性已与 Android、iOS 当前实现对齐
7013
+ * @containerSupport Page | supported
7014
+ * @containerSupport Widget | unsupported
6044
7015
  * @platformSupport Android | supported | 支持监听设备方向变化
6045
7016
  * @platformSupport iOS | supported | 支持监听设备方向变化
6046
7017
  * @platformSupport PC | unsupported | 暂不支持
@@ -6079,6 +7050,8 @@ export declare const onDeviceMotionChange: ClientEventRegistry<DeviceMotionChang
6079
7050
  * ```
6080
7051
  * @since 0.0.27
6081
7052
  * @contractStatus verified | 陀螺仪事件的字段类型与必返性已与 Android、iOS 当前实现对齐
7053
+ * @containerSupport Page | supported
7054
+ * @containerSupport Widget | unsupported
6082
7055
  * @platformSupport Android | supported | 支持监听陀螺仪数据变化
6083
7056
  * @platformSupport iOS | supported | 支持监听陀螺仪数据变化
6084
7057
  * @platformSupport PC | unsupported | 暂不支持
@@ -6116,6 +7089,8 @@ export declare const onGyroscopeChange: ClientEventRegistry<GyroscopeChangeEvent
6116
7089
  * @since 0.0.20
6117
7090
  * @contractStatus verified | 回调字段与 Android、iOS 事件一致;高度单位存在平台差异,已在平台差异中说明。
6118
7091
  * @contractMismatch non-blocking | return | event.height | Android,iOS | 键盘高度,单位 px | Android 返回物理像素高度,iOS 返回逻辑像素(points)高度 | 同一键盘在两端返回的数值口径不同,公开类型可承载 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/event/KeyboardHeightChangeEventHelper.kt; ai-sdk/ios/AISDK/Sources/JSBridge | 统一双端键盘高度的单位口径
7092
+ * @containerSupport Page | supported
7093
+ * @containerSupport Widget | unsupported
6119
7094
  * @platformSupport Android | supported | 支持监听键盘高度变化。
6120
7095
  * @platformSupport iOS | supported | 支持监听键盘高度变化。
6121
7096
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -6155,6 +7130,8 @@ export declare const onKeyboardHeightChange: ClientEventRegistry<KeyboardHeightC
6155
7130
  * @since 0.0.32
6156
7131
  * @contractStatus verified | 豆包 Android、iOS 成功事件均会返回必需的 latitude 和 longitude,其他字段可由公开可选类型承载
6157
7132
  * @contractMismatch non-blocking | return | event.verticalAccuracy、event.horizontalAccuracy | Android,iOS | 两个精度字段均为可选 number | 豆包 Android 固定返回 0,iOS 返回系统定位结果中的精度值 | 双端精度字段语义不同,但不会破坏公开类型 | flow_android/business/applet/impl/src/main/java/com/bytedance/applet/impl/AppletHostLocationActionServiceImpl.kt; flow_ios/flow_iOS/Modules/FlowApplet/Sources/AIBridge/FlowAIBridgeService.swift | 保留平台说明,后续统一双端精度字段语义
7133
+ * @containerSupport Page | supported
7134
+ * @containerSupport Widget | unsupported
6158
7135
  * @platformSupport Android | supported | 支持监听位置变化事件
6159
7136
  * @platformSupport iOS | supported | 支持监听位置变化事件
6160
7137
  * @platformSupport PC | unsupported | 暂不支持
@@ -6203,6 +7180,8 @@ export declare function onLocationChange(callback: LocationChangeListener): () =
6203
7180
  * @since 0.0.32
6204
7181
  * @contractStatus verified | 错误信息必返、错误码可选的公开类型可准确表达双端事件
6205
7182
  * @contractMismatch non-blocking | return | event.errCode | Android,iOS | errCode 为可选 number | 豆包 Android 的定位异常事件固定补充 0;iOS 返回系统错误码,但位置结果无效时可能省略 errCode | 双端字段出现规则不同,但公开可选类型可准确承载 | flow_android/business/applet/impl/src/main/java/com/bytedance/applet/impl/AppletHostLocationActionServiceImpl.kt; flow_ios/flow_iOS/Modules/FlowApplet/Sources/AIBridge/FlowAIBridgeService.swift | 保留平台错误码说明,后续统一双端缺省错误码策略
7183
+ * @containerSupport Page | supported
7184
+ * @containerSupport Widget | unsupported
6206
7185
  * @platformSupport Android | supported | 支持监听位置更新异常事件
6207
7186
  * @platformSupport iOS | supported | 支持监听位置更新异常事件
6208
7187
  * @platformSupport PC | unsupported | 暂不支持
@@ -6254,6 +7233,8 @@ export declare function onLocationChangeError(callback: LocationChangeErrorListe
6254
7233
  *
6255
7234
  * @since 0.0.26
6256
7235
  * @contractStatus verified | 网络状态事件的 isConnected、networkType 字段类型与必返性已与 Android、iOS 当前实现对齐
7236
+ * @containerSupport Page | supported
7237
+ * @containerSupport Widget | unsupported
6257
7238
  * @platformSupport Android | supported | 支持监听网络状态变化
6258
7239
  * @platformSupport iOS | supported | 支持监听网络状态变化
6259
7240
  * @platformSupport PC | unsupported | 暂不支持
@@ -6277,7 +7258,7 @@ export declare const onNetworkStatusChange: ClientEventRegistry<NetworkStatusCha
6277
7258
  /**
6278
7259
  * 监听应用主题变化。
6279
7260
  *
6280
- * 当用户在系统设置或宿主内切换浅色、深色主题时触发。回调参数中的 `theme` 表示切换后的主题,可与
7261
+ * 当用户在系统设置或豆包客户端内切换浅色、深色主题时触发。回调参数中的 `theme` 表示切换后的主题,可与
6281
7262
  * {@link getAppBaseInfo} 返回的 `theme` 字段配合使用。
6282
7263
  *
6283
7264
  * @summary 监听应用主题变化。
@@ -6295,7 +7276,9 @@ export declare const onNetworkStatusChange: ClientEventRegistry<NetworkStatusCha
6295
7276
  *
6296
7277
  * @since 0.0.32
6297
7278
  * @contractStatus verified | 主题变化事件回调只包含必需的 theme 字段,与公开类型一致。
6298
- * @contractMismatch non-blocking | behavior | onThemeChange | Android | 用户切换浅色、深色主题时触发回调 | iOS 由客户端主动派发事件,Android 依赖宿主接入主题变化通知,未接入时可能不触发 | Android 上事件触发依赖宿主接入情况 | packages/open-api/src/basic/system/system.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge; ai-sdk/ios/AISDK/Sources/JSBridge | 统一双端主题变化事件派发,保证 Android 稳定触发
7279
+ * @contractMismatch non-blocking | behavior | onThemeChange | Android | 用户切换浅色、深色主题时触发回调 | iOS 由客户端主动派发事件,Android 依赖豆包客户端接入主题变化通知,未接入时可能不触发 | Android 上事件触发依赖豆包客户端的接入情况 | packages/open-api/src/basic/system/system.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge; ai-sdk/ios/AISDK/Sources/JSBridge | 统一双端主题变化事件派发,保证 Android 稳定触发
7280
+ * @containerSupport Page | supported
7281
+ * @containerSupport Widget | supported
6299
7282
  * @platformSupport Android | supported | 支持注册主题变化监听。
6300
7283
  * @platformSupport iOS | supported | 支持注册主题变化监听。
6301
7284
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -6310,7 +7293,7 @@ export declare const onNetworkStatusChange: ClientEventRegistry<NetworkStatusCha
6310
7293
  * }
6311
7294
  * ```
6312
7295
  * @errorCode none | - | - | Android,iOS | 该监听只接收成功的主题变化事件 | 无需处理
6313
- * @platformNote Android | 主题变化事件依赖宿主接入主题通知,未接入时可能不触发
7296
+ * @platformNote Android | 主题变化事件依赖豆包客户端接入主题通知,未接入时可能不触发
6314
7297
  *
6315
7298
  * @public
6316
7299
  */
@@ -6335,6 +7318,8 @@ export declare function onThemeChange(callback: ThemeChangeListener): () => void
6335
7318
  * @since 0.0.26
6336
7319
  * @contractStatus verified | 用户截屏事件的空参数结构已与 Android、iOS 当前实现对齐;双端检测机制不同但公开类型已准确表达
6337
7320
  * @contractMismatch non-blocking | behavior | 截屏检测机制 | Android,iOS | 监听用户主动截屏 | iOS 监听系统截屏通知全版本可用,Android 14+ 使用系统截屏回调、低版本回退相册变化监听且需读取图片权限 | 低版本 Android 检测准确性与权限依赖不同 | packages/open-api/src/device/screen/on-user-capture-screen.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/event/UserCaptureScreenEventHelper.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeUserCaptureScreenEventHelper.swift | 统一双端截屏检测机制与权限要求
7321
+ * @containerSupport Page | supported
7322
+ * @containerSupport Widget | unsupported
6338
7323
  * @platformSupport Android | supported | 支持监听用户截屏
6339
7324
  * @platformSupport iOS | supported | 支持监听用户截屏
6340
7325
  * @platformSupport PC | unsupported | 暂不支持
@@ -6371,6 +7356,8 @@ export declare const onUserCaptureScreen: ClientEventRegistry<UserCaptureScreenE
6371
7356
  * @since 0.0.37
6372
7357
  * @contractStatus verified | 录屏事件的 state 字段类型与必返性已与 Android、iOS 当前实现对齐;双端支持范围不同但公开类型已准确表达
6373
7358
  * @contractMismatch non-blocking | platform | 录屏事件支持范围 | Android | 监听用户录屏状态变化 | iOS 全版本可用且订阅后立即回报当前状态,Android 仅 Android 15 及以上生效、低版本静默不上报 | 低版本 Android 无法收到录屏事件 | packages/open-api/src/device/screen/on-user-screen-record.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system/AIBridgeScreenMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeScreenMethods.swift | 补齐低版本 Android 录屏事件能力
7359
+ * @containerSupport Page | supported
7360
+ * @containerSupport Widget | unsupported
6374
7361
  * @platformSupport Android | supported | 支持监听用户录屏(Android 15 及以上)
6375
7362
  * @platformSupport iOS | supported | 支持监听用户录屏
6376
7363
  * @platformSupport PC | unsupported | 暂不支持
@@ -6409,6 +7396,8 @@ export declare const onUserScreenRecord: ClientEventRegistry<UserScreenRecordEve
6409
7396
  *
6410
7397
  * @since 0.0.31
6411
7398
  * @contractStatus verified | 双端均可监听 Wi-Fi 连接事件
7399
+ * @containerSupport Page | supported
7400
+ * @containerSupport Widget | unsupported
6412
7401
  * @platformSupport Android | supported | 支持监听 Wi-Fi 连接事件
6413
7402
  * @platformSupport iOS | supported | 支持监听 Wi-Fi 连接事件
6414
7403
  * @platformSupport PC | unsupported | 暂不支持
@@ -6431,73 +7420,6 @@ export declare const onUserScreenRecord: ClientEventRegistry<UserScreenRecordEve
6431
7420
  */
6432
7421
  export declare const onWifiConnected: ClientEventRegistry<WifiConnectedEvent>;
6433
7422
 
6434
- /**
6435
- * 通过 deep link 等方式打开外部应用。
6436
- *
6437
- * @param params - 外部应用打开参数。
6438
- * @returns 返回一个 Promise,成功时解析为外部应用打开结果({@link OpenAppResult})。
6439
- * @example
6440
- * ```typescript
6441
- * import { openApp } from '@doubao-dev/framework/api';
6442
- *
6443
- * const { status } = await openApp({
6444
- * uri: 'demo://detail?id=1',
6445
- * fallbackUrl: 'https://example.com/download'
6446
- * });
6447
- *
6448
- * console.log(status);
6449
- * ```
6450
- *
6451
- * @since 0.0.6
6452
- * @contractStatus conflict | Android 已实现,iOS 未提供可调用实现。
6453
- * @contractMismatch blocking | platform | 打开外部应用 | iOS | 通过 applet.openApp 打开外部应用并返回执行方式 status | 豆包 iOS 暂未提供该能力,调用会返回不支持 | 该 API 在豆包 iOS 无法打开外部应用 | packages/open-api/src/open/business/open-app.ts; ai-sdk/ios/AISDK/Sources/JSBridge/IDL/AbsOpenAppMethodIDL.swift | 补齐豆包 iOS applet.openApp 实现后再在该平台开放文档
6454
- * @platformSupport Android | supported | 支持通过 deep link、应用市场或浏览器兜底打开外部应用。
6455
- * @platformSupport iOS | unsupported | 豆包当前未实现打开外部应用能力。
6456
- * @platformSupport PC | unsupported | 当前未提供该平台实现。
6457
- * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
6458
- * @permission none | - | none | Android | 无需额外权限
6459
- * @precondition Android | 传入合法的 uri。
6460
- * @usageNote All | 建议同时传入 fallbackUrl,当目标应用未安装、deep link 无法命中时可兜底至应用市场或浏览器。iOS 暂不支持,请勿在该平台调用。
6461
- * @resultExample
6462
- * ```json
6463
- * {
6464
- * "status": "deep_link"
6465
- * }
6466
- * ```
6467
- * @platformNote Android | 客户端会依次尝试 deep link、应用市场、浏览器,并通过 status 返回实际执行方式(deep_link、market、browser)。
6468
- * @errorCode none | - | - | Android | 无 API 专属错误码 | 无需处理
6469
- *
6470
- * @public
6471
- */
6472
- export declare const openApp: (params: OpenAppRequest) => Promise<OpenAppResult>;
6473
-
6474
- /** @public */
6475
- export declare interface OpenAppRequest {
6476
- /** 要打开的目标 URI,例如 `scheme://path?query`。 */
6477
- uri: string;
6478
- /**
6479
- * Android 上的目标应用包名,可选。
6480
- *
6481
- * @default -
6482
- */
6483
- targetPackage?: string;
6484
- /**
6485
- * deep link 失败时的兜底 URL,可选。
6486
- *
6487
- * @default -
6488
- */
6489
- fallbackUrl?: string;
6490
- }
6491
-
6492
- /** @public */
6493
- export declare interface OpenAppResult {
6494
- /** 客户端实际执行的打开方式。 */
6495
- status: OpenAppStatus;
6496
- }
6497
-
6498
- /** @public */
6499
- export declare type OpenAppStatus = 'deep_link' | 'market' | 'browser';
6500
-
6501
7423
  /**
6502
7424
  * 打开蓝牙适配器。
6503
7425
  *
@@ -6513,6 +7435,8 @@ export declare type OpenAppStatus = 'deep_link' | 'market' | 'browser';
6513
7435
  * @returns 不包含字段的结果对象。
6514
7436
  * @since 0.0.25
6515
7437
  * @contractStatus verified | 打开蓝牙适配器的入参与返回结构已与 Android、iOS 当前实现对齐
7438
+ * @containerSupport Page | supported
7439
+ * @containerSupport Widget | unsupported
6516
7440
  * @platformSupport Android | supported | 支持打开蓝牙适配器
6517
7441
  * @platformSupport iOS | supported | 支持打开蓝牙适配器
6518
7442
  * @platformSupport PC | unsupported | 暂不支持
@@ -6595,17 +7519,74 @@ export declare interface OpenLocationParams {
6595
7519
  */
6596
7520
  scale?: number;
6597
7521
  /**
6598
- * 经度
7522
+ * 经度
7523
+ *
7524
+ * @constraint -180 至 180
7525
+ */
7526
+ longitude: number;
7527
+ /**
7528
+ * 纬度
7529
+ *
7530
+ * @constraint -90 至 90
7531
+ */
7532
+ latitude: number;
7533
+ }
7534
+
7535
+ /**
7536
+ * 打开应用内页面。
7537
+ *
7538
+ * 在主对话流卡片中调用时会重新打开全页并忽略 `mode`;在全页或全页内 Chat UI 的卡片中调用时按照
7539
+ * `mode` 操作页面栈。
7540
+ *
7541
+ * @param params 打开页面参数,字段见 {@link OpenPageParams}。
7542
+ * @returns 无返回字段。
7543
+ * @example
7544
+ * ```typescript
7545
+ * import { openPage } from '@doubao-dev/framework/api';
7546
+ *
7547
+ * await openPage({
7548
+ * url: '/pages/detail/index?id=1',
7549
+ * mode: 'navigate'
7550
+ * });
7551
+ * ```
7552
+ *
7553
+ * @since 0.0.43
7554
+ * @contractStatus verified | Android、iOS 均支持通过 url 和页面栈 mode 打开应用内页面。
7555
+ * @platformSupport Android | supported | 支持 push、replace、navigate 和 pop_to 页面栈操作。
7556
+ * @platformSupport iOS | supported | 支持 push、replace、navigate 和 pop_to 页面栈操作。
7557
+ * @platformSupport PC | unsupported | 当前未提供该平台实现。
7558
+ * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
7559
+ * @permission none | - | none | Android,iOS | 无需额外权限
7560
+ * @precondition All | 无额外前置条件
7561
+ * @usageNote All | mode 省略时按 push 处理;主对话流卡片中重新打开全页,全页及其 Chat UI 中应用页面栈操作。
7562
+ * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
7563
+ *
7564
+ * @public
7565
+ */
7566
+ export declare const openPage: (params: OpenPageParams) => Promise<object>;
7567
+
7568
+ /**
7569
+ * 打开页面时使用的页面栈操作。
7570
+ *
7571
+ * @public
7572
+ */
7573
+ export declare type OpenPageMode = 'push' | 'replace' | 'navigate' | 'pop_to';
7574
+
7575
+ /** @public */
7576
+ export declare interface OpenPageParams {
7577
+ /** 应用内页面路径,可携带查询参数。 */
7578
+ url: string;
7579
+ /**
7580
+ * 页面栈操作。
6599
7581
  *
6600
- * @constraint -180 至 180
6601
- */
6602
- longitude: number;
6603
- /**
6604
- * 纬度
7582
+ * - `push`:始终压入新的页面实例。
7583
+ * - `replace`:目标为栈顶页面时更新栈顶页面,否则替换栈顶页面。
7584
+ * - `navigate`:目标已在栈中时回退到最近的目标页面并更新,否则压入新页面。
7585
+ * - `pop_to`:目标已在栈中时回退到最近的目标页面并更新,否则替换栈顶页面。
6605
7586
  *
6606
- * @constraint -90 至 90
7587
+ * @default 'push'
6607
7588
  */
6608
- latitude: number;
7589
+ mode?: OpenPageMode;
6609
7590
  }
6610
7591
 
6611
7592
  /**
@@ -6616,7 +7597,7 @@ export declare interface OpenLocationParams {
6616
7597
  * @returns Promise 对象,设置页关闭后返回最新授权设置
6617
7598
  * @remarks
6618
7599
  * 该接口不要求在用户点击事件中调用。
6619
- * 注意:当前宿主暂不支持订阅模板,传入 `withSubscriptions: true` 时会由宿主返回失败,错误信息为 `subscription templates are not supported yet`。
7600
+ * JavaScript 调用方也不要传入 `withSubscriptions: true`,否则豆包会返回 `subscription templates are not supported yet`。
6620
7601
  * @example
6621
7602
  * ```typescript
6622
7603
  * import { openSetting } from '@doubao-dev/framework/api';
@@ -6631,12 +7612,15 @@ export declare interface OpenLocationParams {
6631
7612
  *
6632
7613
  * @since 0.0.39
6633
7614
  * @contractStatus verified | withSubscriptions 当前仅允许 false,Android、iOS 均支持打开设置页并返回授权设置。
7615
+ * @containerSupport Page | supported
7616
+ * @containerSupport Widget | supported
6634
7617
  * @platformSupport Android | supported | 支持打开授权设置页并在关闭后返回最新授权设置。
6635
7618
  * @platformSupport iOS | supported | 支持打开授权设置页并在关闭后返回最新授权设置。
6636
7619
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
6637
7620
  * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
6638
7621
  * @permission none | - | none | Android,iOS | 无需额外权限
6639
7622
  * @precondition All | 无额外前置条件,不要求在用户点击事件中调用。
7623
+ * @usageNote All | 设置页只能修改当前智能服务的 scope,不承载 HealthKit 系统权限设置。
6640
7624
  * @usageNote All | 豆包当前不支持订阅模板,不要传入 withSubscriptions: true。
6641
7625
  * @resultExample
6642
7626
  * ```json
@@ -6668,10 +7652,104 @@ export declare interface OpenSettingOptions {
6668
7652
  export declare interface OpenSettingResult {
6669
7653
  /** 用户授权结果,key 为权限 scope,value 表示是否已授权 */
6670
7654
  authSetting: AuthSetting;
6671
- /** 用户订阅消息设置,withSubscriptions 为 true 时才会返回 */
7655
+ /** 预留的订阅消息设置字段。豆包当前仅支持 `withSubscriptions: false`,因此不会返回该字段。 */
6672
7656
  subscriptionsSetting?: SubscriptionsSetting;
6673
7657
  }
6674
7658
 
7659
+ /** @public */
7660
+ declare interface Performance_2 {
7661
+ /**
7662
+ * 创建性能观察者。调用返回对象的 `observe` 后,回调会接收之后新完成且匹配的 Entry。
7663
+ */
7664
+ createObserver: (callback: PerformanceObserverCallback_2) => PerformanceObserver_2;
7665
+ /** 设置客户端最多保留的性能 Entry 数量。 */
7666
+ setBufferSize: (size: number) => void;
7667
+ /** 返回当前智能服务已记录的全部性能 Entry。 */
7668
+ getEntries: () => PerformanceEntry_2[];
7669
+ /** 返回指定 entryType 的性能 Entry。 */
7670
+ getEntriesByType: (entryType: string) => PerformanceEntry_2[];
7671
+ /** 返回指定名称的性能 Entry;传入 entryType 时同时按类型筛选。 */
7672
+ getEntriesByName: (name: string, entryType?: string) => PerformanceEntry_2[];
7673
+ }
7674
+ export { Performance_2 as Performance }
7675
+
7676
+ /** @public */
7677
+ declare interface PerformanceEntry_2 {
7678
+ /** 性能指标所属类别。 */
7679
+ entryType: PerformanceEntryType;
7680
+ /** 性能指标名称,例如 `appLaunch`、`route`、`evaluateScript` 或 `firstRender`。 */
7681
+ name: string;
7682
+ /** 指标开始或发生时刻的 Unix 时间戳,单位为毫秒。 */
7683
+ startTime: number;
7684
+ /** 指标持续时间,单位为毫秒;仅耗时类指标提供。 */
7685
+ duration?: number;
7686
+ /** 页面路径;仅页面的 navigation 和 render 类型指标提供。 */
7687
+ path?: string;
7688
+ /** `path` 对应的页面实例 Id(随机生成,不保证递增);仅页面相关指标提供。 */
7689
+ pageId?: number;
7690
+ /** 路由来源页面的路径;仅 `navigation / route` 指标提供。 */
7691
+ referrerPath?: string;
7692
+ /** 路由来源页面的实例 ID;仅 `navigation / route` 指标提供。 */
7693
+ referrerPageId?: number;
7694
+ /** 路由开始被渲染层处理的 Unix 时间戳,单位为毫秒;仅 navigation 类型指标提供。 */
7695
+ navigationStart?: number;
7696
+ /** 路由类型。仅 navigation 类型的 Entry 有效。 */
7697
+ navigationType?: string;
7698
+ /** 被执行脚本的模块名称;仅 `script / evaluateScript` 指标提供。 */
7699
+ moduleName?: string;
7700
+ /** 视图层准备完成的 Unix 时间戳,单位为毫秒;仅 `render / firstRender` 指标提供。 */
7701
+ viewLayerReadyTime?: number;
7702
+ /** 视图层首次渲染开始的 Unix 时间戳,单位为毫秒;仅 `render / firstRender` 指标提供。 */
7703
+ viewLayerRenderStartTime?: number;
7704
+ /** 视图层首次渲染结束的 Unix 时间戳,单位为毫秒;仅 `render / firstRender` 指标提供。 */
7705
+ viewLayerRenderEndTime?: number;
7706
+ /** Widget 标识;仅 Widget 的 render 类型指标提供。 */
7707
+ widgetId?: string;
7708
+ /** Widget 实例 Id(随机生成,不保证递增);仅 Widget 的 render 类型指标提供。 */
7709
+ widgetInstanceId?: string;
7710
+ /** Widget 关联的应用是否冷启动;仅 Widget 的 render 类型指标提供。 */
7711
+ isAppColdLaunch?: boolean;
7712
+ }
7713
+ export { PerformanceEntry_2 as PerformanceEntry }
7714
+
7715
+ /** @public */
7716
+ export declare type PerformanceEntryType = 'navigation' | 'script' | 'render';
7717
+
7718
+ /** @public */
7719
+ declare interface PerformanceObserver_2 {
7720
+ observe(options: PerformanceObserverOptions): void;
7721
+ disconnect(): void;
7722
+ }
7723
+ export { PerformanceObserver_2 as PerformanceObserver }
7724
+
7725
+ /** @public */
7726
+ declare type PerformanceObserverCallback_2 = (entryList: PerformanceObserverEntryList_2) => void;
7727
+ export { PerformanceObserverCallback_2 as PerformanceObserverCallback }
7728
+
7729
+ /** @public */
7730
+ declare interface PerformanceObserverEntryList_2 {
7731
+ getEntries(): PerformanceEntry_2[];
7732
+ getEntriesByType(entryType: string): PerformanceEntry_2[];
7733
+ getEntriesByName(name: string, entryType?: string): PerformanceEntry_2[];
7734
+ }
7735
+ export { PerformanceObserverEntryList_2 as PerformanceObserverEntryList }
7736
+
7737
+ /** @public */
7738
+ export declare interface PerformanceObserverOptions {
7739
+ entryTypes: string[];
7740
+ }
7741
+
7742
+ /**
7743
+ * 系统日历精细授权状态。
7744
+ *
7745
+ * 继承 {@link BasicAuthorizationDetail} 的全部取值,并增加:
7746
+ * - `read only`:只能读取日历,不能新增、修改或删除日程;仅 Android 支持。
7747
+ * - `write only`:只能新增日程,不能读取现有日历数据。
7748
+ *
7749
+ * @public
7750
+ */
7751
+ export declare type PhoneCalendarAuthorizationDetail = BasicAuthorizationDetail | 'read only' | 'write only';
7752
+
6675
7753
  /**
6676
7754
  * 插件账号信息(仅在插件中调用时包含)。
6677
7755
  *
@@ -6715,6 +7793,8 @@ export declare interface PluginAccountInfo {
6715
7793
  * @contractStatus conflict | result 为 false 时双端回传行为不一致,且 result 为 true 时 code 实为必填。
6716
7794
  * @contractMismatch blocking | behavior | params.result | Android,iOS | result 为 false 用于回传登录失败结果,回传完成后 Promise 正常 resolve | Android 在 result 为 false 时正常 resolve,iOS 在 result 为 false 时以失败 reject(message 为 "no login result") | 调用方无法用统一方式判断失败结果是否已回传成功 | packages/open-api/src/open/login/post-mcp-login.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/login/PostLoginResultMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Auth/AIBridgePostLoginResultMethod.swift | 统一 result 为 false 时的双端回传结果语义
6717
7795
  * @contractMismatch blocking | parameter | params.code | Android,iOS | code 声明为可选,仅在登录结果为 true 时有效 | result 为 true 时若 code 缺省或为空,双端均按失败处理(Android reject、iOS reject) | 调用方误以为成功回传可省略 code | packages/open-api/src/open/login/post-mcp-login.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/login/PostLoginResultMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Auth/AppletPageLoginManager.swift | 将 code 约束为 result 为 true 时必填
7796
+ * @containerSupport Page | supported
7797
+ * @containerSupport Widget | supported
6718
7798
  * @platformSupport Android | supported | 支持向豆包回传 MCP 授权登录结果。
6719
7799
  * @platformSupport iOS | supported | 支持向豆包回传 MCP 授权登录结果。
6720
7800
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -6723,7 +7803,24 @@ export declare interface PluginAccountInfo {
6723
7803
  * @precondition Android | 先完成登录,并传入登录成功返回的有效 code。
6724
7804
  * @precondition iOS | 先完成登录,并传入登录成功返回的有效 code。
6725
7805
  * @usageNote All | 仅在完成 MCP 授权登录流程后回传结果;登录成功时必须携带有效 code,回传成功后不要重复回传。
6726
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
7806
+ * @errorExample
7807
+ * ```json
7808
+ * {
7809
+ * "errNo": 105,
7810
+ * "errMsg": "authentication fail"
7811
+ * }
7812
+ * ```
7813
+ * @errorCode common | 102 | Android,iOS
7814
+ * @errorCode errNo | 104 | invalid parameter | Android | result 为 true 但缺少有效的兑换 code | 传入业务服务端生成的有效 code 后重试。
7815
+ * @errorCode errNo | 105 | authentication fail | Android,iOS | 登录被拒绝或兑换 code 校验未通过 | 确认业务登录状态与 code 是否有效后重试。
7816
+ * @errorCode errNo | 112 | invalid result | Android,iOS | Token 交换服务返回的数据无法解析 | 稍后重试;持续失败时反馈服务端响应异常。
7817
+ * @errorCode errNo | 115 | operation timeout | Android | Token 交换耗时超过限制 | 检查网络后重试。
7818
+ * @errorCode errNo | 301 | network request cancelled | iOS | Token 交换的网络请求被取消 | 确认应用和网络状态后重试。
7819
+ * @errorCode errNo | 302 | connection timed out | Android,iOS | Token 交换的网络连接超时 | 检查网络连接后重试。
7820
+ * @errorCode errNo | 303 | no network connection | Android,iOS | 当前无可用网络连接 | 恢复网络连接后重试。
7821
+ * @errorCode errNo | 305 | network failure | Android,iOS | Token 交换时发生其他网络错误 | 检查网络连接,稍后重试。
7822
+ * @platformNote Android | 缺少有效 code 时返回 104;调用超时返回 115。
7823
+ * @platformNote iOS | 缺少有效 code 时返回 102;网络请求被取消时返回 301,超时归类为 302。
6727
7824
  *
6728
7825
  * @public
6729
7826
  */
@@ -6766,6 +7863,8 @@ export declare interface PostLoginResultRequest {
6766
7863
  * @contractStatus conflict | current 的数字下标形式和 referrerPolicy 在 Android、iOS 当前实现中不生效
6767
7864
  * @contractMismatch blocking | parameter | current | Android,iOS | 可传图片链接或数字下标指定首张图片 | 只按字符串形式与 urls 中的完整图片地址匹配,数字下标不能定位图片 | 传入数字下标时会从第一张图片开始预览 | packages/open-api/src/media/image.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/media/PreviewImageMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Media/AIBridgeImageMethods.swift; flow_android/business/applet/impl/src/main/java/com/bytedance/applet/impl/AppletHostImageServiceImpl.kt; flow_ios/flow_iOS/Modules/FlowApplet/Sources/AIBridge/FlowAIBridgeService.swift | 让双端支持数字下标,或从公开类型中移除数字形式
6768
7865
  * @contractMismatch blocking | parameter | referrerPolicy | Android,iOS | 用 referrerPolicy 控制预览页的 Referrer 策略 | 调用时忽略 referrerPolicy,预览请求不会应用该策略 | 调用方配置的 Referrer 策略不生效 | packages/open-api/src/media/image.ts; ai-sdk/android/ai-sdk/build/api/com/bytedance/ai/bridge/media/image/AbsPreviewImageMethodIDL.kt; ai-sdk/ios/AISDK/Sources/JSBridge/IDL/Media/AbsPreviewImageMethodIDL.swift | 补齐参数透传与预览请求配置,或移除公开字段
7866
+ * @containerSupport Page | supported
7867
+ * @containerSupport Widget | supported
6769
7868
  * @platformSupport Android | supported | 支持预览网络图片和豆包智能服务本地图片
6770
7869
  * @platformSupport iOS | supported | 支持预览网络图片和豆包智能服务本地图片
6771
7870
  * @platformSupport PC | unsupported | 暂不支持
@@ -6865,6 +7964,8 @@ export declare interface PrivacySettingResult {
6865
7964
  * @returns 不包含字段的结果对象。
6866
7965
  * @since 0.0.25
6867
7966
  * @contractStatus verified | 读取特征值的入参与返回结构已与 Android、iOS 当前实现对齐
7967
+ * @containerSupport Page | supported
7968
+ * @containerSupport Widget | unsupported
6868
7969
  * @platformSupport Android | supported | 支持读取 BLE 特征值
6869
7970
  * @platformSupport iOS | supported | 支持读取 BLE 特征值
6870
7971
  * @platformSupport PC | unsupported | 暂不支持
@@ -7126,6 +8227,8 @@ export declare type RecorderSampleRate = 8000 | 11025 | 12000 | 16000 | 22050 |
7126
8227
  *
7127
8228
  * @since 0.0.19
7128
8229
  * @contractStatus verified | 公开参数、跳转语义及 Android、iOS 失败字段已核对一致。
8230
+ * @containerSupport Page | supported
8231
+ * @containerSupport Widget | unsupported
7129
8232
  * @platformSupport Android | supported | 支持关闭当前页面并跳转到指定页面。
7130
8233
  * @platformSupport iOS | supported | 支持关闭当前页面并跳转到指定页面。
7131
8234
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -7133,7 +8236,15 @@ export declare type RecorderSampleRate = 8000 | 11025 | 12000 | 16000 | 22050 |
7133
8236
  * @permission none | - | none | Android,iOS | 无需额外权限
7134
8237
  * @precondition All | 无额外前置条件
7135
8238
  * @usageNote All | url 为智能服务内的页面路径,可携带查询参数;跳转会替换当前页面,不保留在页面栈中。
7136
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
8239
+ * @errorExample
8240
+ * ```json
8241
+ * {
8242
+ * "errNo": 104,
8243
+ * "errMsg": "invalid url"
8244
+ * }
8245
+ * ```
8246
+ * @errorCode common | 102 | Android,iOS
8247
+ * @errorCode errNo | 104 | invalid url | Android,iOS | url 为空或无法解析为有效的智能服务页面路径 | 检查 url 是否为合法的应用内页面路径后重试。
7137
8248
  *
7138
8249
  * @public
7139
8250
  */
@@ -7153,6 +8264,8 @@ export declare const redirectTo: (params: NavigateToParams) => Promise<object>;
7153
8264
  *
7154
8265
  * @since 0.0.19
7155
8266
  * @contractStatus verified | 公开参数、跳转语义及 Android、iOS 失败字段已核对一致。
8267
+ * @containerSupport Page | supported
8268
+ * @containerSupport Widget | unsupported
7156
8269
  * @platformSupport Android | supported | 支持关闭所有页面并跳转到指定页面。
7157
8270
  * @platformSupport iOS | supported | 支持关闭所有页面并跳转到指定页面。
7158
8271
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -7160,7 +8273,15 @@ export declare const redirectTo: (params: NavigateToParams) => Promise<object>;
7160
8273
  * @permission none | - | none | Android,iOS | 无需额外权限
7161
8274
  * @precondition All | 无额外前置条件
7162
8275
  * @usageNote All | url 为智能服务内的页面路径,可携带查询参数;跳转会关闭现有全部页面并以目标页面作为唯一页面。
7163
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
8276
+ * @errorExample
8277
+ * ```json
8278
+ * {
8279
+ * "errNo": 104,
8280
+ * "errMsg": "invalid url"
8281
+ * }
8282
+ * ```
8283
+ * @errorCode common | 102 | Android,iOS
8284
+ * @errorCode errNo | 104 | invalid url | Android,iOS | url 为空或无法解析为有效的智能服务页面路径 | 检查 url 是否为合法的应用内页面路径后重试。
7164
8285
  *
7165
8286
  * @public
7166
8287
  */
@@ -7226,6 +8347,8 @@ export declare interface RemoveSavedFileParams {
7226
8347
  *
7227
8348
  * @since 0.0.17
7228
8349
  * @contractStatus verified | 公开参数、删除语义及 Android、iOS 错误字段已核对一致。
8350
+ * @containerSupport Page | supported
8351
+ * @containerSupport Widget | supported
7229
8352
  * @platformSupport Android | supported | 支持按智能服务维度删除指定 key。
7230
8353
  * @platformSupport iOS | supported | 支持按智能服务维度删除指定 key。
7231
8354
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -7268,6 +8391,8 @@ export declare interface RemoveStorageParams {
7268
8391
  *
7269
8392
  * @since 0.0.19
7270
8393
  * @contractStatus verified | 公开参数、删除语义及 Android、iOS 错误字段已核对一致。
8394
+ * @containerSupport Page | supported
8395
+ * @containerSupport Widget | supported
7271
8396
  * @platformSupport Android | supported | 支持按智能服务维度同步删除指定 key。
7272
8397
  * @platformSupport iOS | supported | 支持按智能服务维度同步删除指定 key。
7273
8398
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -7330,6 +8455,8 @@ export declare interface RenameParams {
7330
8455
  *
7331
8456
  * @since 0.0.28
7332
8457
  * @contractStatus verified | 事件名与事件参数会被 Android、iOS 一并上报,公开参数与双端消费一致。
8458
+ * @containerSupport Page | supported
8459
+ * @containerSupport Widget | supported
7333
8460
  * @platformSupport Android | supported | 支持上报智能服务数据分析事件。
7334
8461
  * @platformSupport iOS | supported | 支持上报智能服务数据分析事件。
7335
8462
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -7337,7 +8464,7 @@ export declare interface RenameParams {
7337
8464
  * @permission none | - | none | Android,iOS | 无需额外权限
7338
8465
  * @precondition All | 无额外前置条件。
7339
8466
  * @usageNote All | 事件名与事件参数会用于数据分析,请勿写入用户隐私或敏感数据。
7340
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
8467
+ * @errorCode common | 102 | Android,iOS
7341
8468
  *
7342
8469
  * @public
7343
8470
  */
@@ -7384,6 +8511,8 @@ export declare interface ReportEventParams {
7384
8511
  * @contractStatus conflict | method 支持范围与 arraybuffer 返回类型在 Android、iOS 均与公开类型不一致
7385
8512
  * @contractMismatch blocking | parameter | method | Android,iOS | 公开类型声明 GET/POST/PUT/DELETE/HEAD/OPTIONS/TRACE/CONNECT 八种方法 | Android 仅支持 GET/POST/PUT/DELETE,其余方法返回 "Illegal method";iOS 仅支持 GET/POST,其余方法返回 "method type not supported" | 调用 PUT/DELETE 时 iOS 会失败;调用 HEAD/OPTIONS/TRACE/CONNECT 时双端均失败 | packages/open-api/src/network/request.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/net/RequestMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Network/AIBridgeRequestMethod.swift | 收窄公开类型声明,或在文档明确各端实际支持范围
7386
8513
  * @contractMismatch blocking | return | RequestResponse.data | Android,iOS | dataType 传入 arraybuffer 时声明返回 ArrayBuffer | Android 将二进制响应以 base64 字符串返回;iOS doubao.request 路径不启用 arraybuffer 支持,返回 base64 编码字符串 | 调用方按 ArrayBuffer 解析会失败 | packages/open-api/src/network/request.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/net/RequestMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Network/AIBridgeRequestMethod.swift | 统一双端 arraybuffer 返回语义,或在文档说明实际返回 base64 字符串
8514
+ * @containerSupport Page | supported
8515
+ * @containerSupport Widget | supported
7387
8516
  * @platformSupport Android | supported | 支持发起 HTTP/HTTPS 网络请求,method 支持 GET/POST/PUT/DELETE。
7388
8517
  * @platformSupport iOS | supported | 支持发起 HTTP/HTTPS 网络请求,method 仅支持 GET/POST。
7389
8518
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -7402,7 +8531,22 @@ export declare interface ReportEventParams {
7402
8531
  * }
7403
8532
  * }
7404
8533
  * ```
7405
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
8534
+ * @errorExample
8535
+ * ```json
8536
+ * {
8537
+ * "errNo": 305,
8538
+ * "errMsg": "network failure"
8539
+ * }
8540
+ * ```
8541
+ * @errorCode common | 102 | iOS
8542
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | url 为空、method 非法,或请求参数、请求体校验失败 | 修正 url、method 与请求参数后重试。
8543
+ * @errorCode errNo | 110 | API call prohibited | Android,iOS | 请求 URL 未通过域名白名单校验 | 确认目标域名已在智能服务中配置后重试。
8544
+ * @errorCode errNo | 301 | network request cancelled | iOS | 网络请求被取消 | 确认应用与网络状态后重试。
8545
+ * @errorCode errNo | 302 | connection timed out | Android,iOS | 网络连接超时 | 检查网络连接后重试。
8546
+ * @errorCode errNo | 303 | no network connection | Android,iOS | 当前无可用网络连接 | 恢复网络连接后重试。
8547
+ * @errorCode errNo | 305 | network failure | Android,iOS | 发生其他网络错误 | 检查网络连接,稍后重试。
8548
+ * @platformNote Android | 网络失败仅细分为 302(HTTP 408 超时)、303(无网络连接)与 305(其他网络错误),不返回 301;url 为空或 method 非法返回 104;命中域名管控返回 110。
8549
+ * @platformNote iOS | 依据 NSURLError 细分网络失败:请求取消 301、连接超时 302、无网络 303、其他 305;参数或请求体校验失败返回 104;命中域名管控返回 110;其他失败统一返回 102。
7406
8550
  *
7407
8551
  * @public
7408
8552
  */
@@ -7440,6 +8584,8 @@ export declare type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' |
7440
8584
  *
7441
8585
  * @since 0.0.28
7442
8586
  * @contractStatus verified | 成功返回结构与 Android、iOS 一致;失败通过 Promise reject,业务错误在错误对象的 data 字段。
8587
+ * @containerSupport Page | supported
8588
+ * @containerSupport Widget | supported
7443
8589
  * @platformSupport Android | supported | 支持发起订单支付流程并返回 orderId。
7444
8590
  * @platformSupport iOS | supported | 支持发起订单支付流程并返回 orderId。
7445
8591
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -7455,7 +8601,7 @@ export declare type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' |
7455
8601
  * "logId": "20260519xxxx"
7456
8602
  * }
7457
8603
  * ```
7458
- * @errorCode none | - | - | Android,iOS | 无稳定的顶层 errNo/errMsg;调用失败时 Promise reject,业务错误(errNo、errMsg、errLogId)在错误对象的 data 字段 | 通过 catch 捕获并读取 e.data 排查
8604
+ * @errorCode common | 102 | Android,iOS
7459
8605
  * @knownIssue All | 失败结果不会作为 await 的返回值,需通过 catch 捕获并从错误对象的 data 字段读取 errNo、errMsg、errLogId。
7460
8606
  *
7461
8607
  * @public
@@ -7626,6 +8772,8 @@ export declare interface SaveFileResult {
7626
8772
  * ```
7627
8773
  * @since 0.0.26
7628
8774
  * @contractStatus verified | Android、iOS 均可将有效本地图片写入系统相册
8775
+ * @containerSupport Page | supported
8776
+ * @containerSupport Widget | unsupported
7629
8777
  * @platformSupport Android | supported | 支持将本地图片保存到系统相册
7630
8778
  * @platformSupport iOS | supported | 支持将本地图片保存到系统相册
7631
8779
  * @platformSupport PC | unsupported | 暂不支持
@@ -7673,6 +8821,8 @@ export declare interface SaveImageToPhotosAlbumParams {
7673
8821
  * @contractStatus conflict | onlyFromCamera/scanType 参数的生效情况及取消行为双端不一致
7674
8822
  * @contractMismatch blocking | parameter | scanType | Android,iOS | 限制允许的扫码类型 | 双端对 scanType 的过滤支持不一致,部分取值可能不生效 | 依赖类型过滤的调用方可能扫出预期外的码型 | packages/open-api/src/device/scan/scan.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/AIBridgeScanMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeScanMethods.swift | 统一双端扫码类型过滤能力
7675
8823
  * @contractMismatch non-blocking | behavior | 用户取消 | Android,iOS | 用户取消扫码时的返回未在公开类型体现 | 双端在用户取消时的失败表现不一致 | 调用方需分别处理双端的取消结果 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/AIBridgeScanMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeScanMethods.swift | 统一取消扫码的返回语义
8824
+ * @containerSupport Page | supported
8825
+ * @containerSupport Widget | supported
7676
8826
  * @platformSupport Android | supported | 支持调起扫码
7677
8827
  * @platformSupport iOS | supported | 支持调起扫码
7678
8828
  * @platformSupport PC | unsupported | 暂不支持
@@ -7691,7 +8841,16 @@ export declare interface SaveImageToPhotosAlbumParams {
7691
8841
  * "scanType": "QR_CODE"
7692
8842
  * }
7693
8843
  * ```
7694
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认相机权限及用户是否取消
8844
+ * @errorExample
8845
+ * ```json
8846
+ * {
8847
+ * "errNo": 103,
8848
+ * "errMsg": "feature not support"
8849
+ * }
8850
+ * ```
8851
+ * @errorCode common | 102 | Android,iOS
8852
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 当前豆包版本或运行环境未提供扫码能力 | 在支持扫码能力的豆包版本中调用。
8853
+ * @errorCode errNo | 112 | invalid result | iOS | 扫码成功但未返回可用的扫码结果数据 | 稍后重试;持续失败时反馈扫码结果异常。
7695
8854
  *
7696
8855
  * @public
7697
8856
  */
@@ -7751,7 +8910,7 @@ export declare type ScanCodeType = 'barCode' | 'qrCode' | 'datamatrix' | 'pdf417
7751
8910
  export declare type ScanResultType = 'QR_CODE' | 'AZTEC' | 'CODABAR' | 'CODE_39' | 'CODE_93' | 'CODE_128' | 'DATA_MATRIX' | 'EAN_8' | 'EAN_13' | 'ITF' | 'MAXICODE' | 'PDF_417' | 'RSS_14' | 'RSS_EXPANDED' | 'UPC_A' | 'UPC_E' | 'UPC_EAN_EXTENSION' | 'WX_CODE' | 'CODE_25';
7752
8911
 
7753
8912
  /** @public */
7754
- export declare type Scope = 'scope.userLocation' | 'scope.userFuzzyLocation' | 'scope.userLocationBackground' | 'scope.payment' | 'scope.record' | 'scope.bluetooth' | 'scope.camera' | 'scope.addPhoneContact' | 'scope.addPhoneCalendar';
8913
+ export declare type Scope = 'scope.userLocation' | 'scope.userFuzzyLocation' | 'scope.userLocationBackground' | 'scope.payment' | 'scope.record' | 'scope.bluetooth' | 'scope.camera' | 'scope.addPhoneContact' | 'scope.addPhoneCalendar' | 'scope.healthData';
7755
8914
 
7756
8915
  /**
7757
8916
  * 选择消息文件后返回的文件类型。
@@ -7761,7 +8920,7 @@ export declare type Scope = 'scope.userLocation' | 'scope.userFuzzyLocation' | '
7761
8920
  export declare type SelectedMessageFileType = 'video' | 'image' | 'file';
7762
8921
 
7763
8922
  /**
7764
- * 以用户身份发送后续消息,触发新一轮对话或 API 调用。
8923
+ * 以用户身份发送后续消息,触发新一轮对话、API 调用或引导模型响应。
7765
8924
  *
7766
8925
  * @param params - 要发送的后续消息内容。
7767
8926
  * @returns 返回一个 Promise,在消息发送请求提交后解析。
@@ -7782,6 +8941,13 @@ export declare type SelectedMessageFileType = 'video' | 'image' | 'file';
7782
8941
  * name: 'selectDrink',
7783
8942
  * arguments: { drinkId: 'latte_001' }
7784
8943
  * }
8944
+ * },
8945
+ * {
8946
+ * type: 'responseHint',
8947
+ * data: {
8948
+ * userAction: '用户选择了拿铁',
8949
+ * responseGuidance: '确认已选择拿铁,并询问是否需要调整杯型'
8950
+ * }
7785
8951
  * }
7786
8952
  * ]
7787
8953
  * });
@@ -7789,6 +8955,8 @@ export declare type SelectedMessageFileType = 'video' | 'image' | 'file';
7789
8955
  *
7790
8956
  * @since 0.0.37
7791
8957
  * @contractStatus verified | 公开参数与 Android、iOS 的消息提交行为一致。
8958
+ * @containerSupport Page | supported
8959
+ * @containerSupport Widget | supported
7792
8960
  * @platformSupport Android | supported | 支持在卡片或智能服务页面中发送后续消息。
7793
8961
  * @platformSupport iOS | supported | 支持在卡片和智能服务页面中发送后续消息。
7794
8962
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -7823,7 +8991,7 @@ export declare interface SendFollowUpMessageParams {
7823
8991
  *
7824
8992
  * @param params - 消息内容及类型。
7825
8993
  * @returns 返回一个 Promise,在消息成功发送时解析。
7826
- * @deprecated 使用 {@link dispatchActionDirective} 描述用户行为并约束模型后续动作。
8994
+ * @deprecated 使用 {@link sendFollowUpMessage} 发送后续消息。
7827
8995
  * @summary 以用户身份发送消息。
7828
8996
  * @example
7829
8997
  * ```typescript
@@ -7844,7 +9012,7 @@ export declare interface SendFollowUpMessageParams {
7844
9012
  * @permission none | - | none | Android,iOS | 无需额外权限
7845
9013
  * @precondition Android | 在卡片或页面环境中调用,由客户端自动获取页面上下文确定目标 bot。
7846
9014
  * @precondition iOS | 在卡片或页面环境中调用,由客户端自动获取页面上下文确定目标 bot。
7847
- * @usageNote All | 该 API 已废弃,请改用 dispatchActionDirective 描述用户行为并约束模型后续动作。
9015
+ * @usageNote All | 该 API 已废弃,请改用 sendFollowUpMessage 发送后续消息。
7848
9016
  * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
7849
9017
  *
7850
9018
  * @internal
@@ -7876,6 +9044,8 @@ export declare interface SendQueryMessageParams {
7876
9044
  * @since 0.0.25
7877
9045
  * @contractStatus conflict | 拉起短信面板的成功语义双端不一致
7878
9046
  * @contractMismatch blocking | behavior | 拉起短信面板成功语义 | Android,iOS | 成功拉起系统短信面板时解析 | Android 通过 Intent 打开短信应用即成功,iOS 通过 MFMessageComposeViewController 呈现并在用户完成/取消后回调,成功时机不同 | 相同调用在双端"成功"代表的实际状态不同 | packages/open-api/src/device/sms/sms.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/AIBridgeSmsMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeSmsMethods.swift | 统一双端拉起短信面板的成功语义
9047
+ * @containerSupport Page | supported
9048
+ * @containerSupport Widget | supported
7879
9049
  * @platformSupport Android | supported | 支持拉起系统短信面板
7880
9050
  * @platformSupport iOS | supported | 支持拉起系统短信面板
7881
9051
  * @platformSupport PC | unsupported | 暂不支持
@@ -7887,7 +9057,17 @@ export declare interface SendQueryMessageParams {
7887
9057
  * ```json
7888
9058
  * {}
7889
9059
  * ```
7890
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认设备是否支持短信
9060
+ * @errorExample
9061
+ * ```json
9062
+ * {
9063
+ * "errNo": 114,
9064
+ * "errMsg": "operation cancelled"
9065
+ * }
9066
+ * ```
9067
+ * @errorCode common | 102 | Android,iOS
9068
+ * @errorCode errNo | 103 | feature not support | iOS | 当前设备不支持发送短信 | 在支持短信的设备上调用,或提前提示用户设备不支持短信。
9069
+ * @errorCode errNo | 114 | operation cancelled | iOS | 用户在系统短信面板中取消了发送 | 用户需要时可再次调用 `sendSms` 重新拉起短信面板。
9070
+ * @platformNote iOS | 拉起短信面板后用户取消返回 114、发送失败返回 102、设备不支持短信返回 103;Android 无法拉起短信应用时返回 102。
7891
9071
  *
7892
9072
  * @public
7893
9073
  */
@@ -7948,7 +9128,18 @@ export declare type SensorInterval = 'game' | 'ui' | 'normal';
7948
9128
  * @precondition Android | 无额外前置条件
7949
9129
  * @precondition iOS | 无额外前置条件
7950
9130
  * @usageNote All | 该 API 已废弃,请改用 updateModelContext 按任务或实体维度补充模型上下文。
7951
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
9131
+ * @errorExample
9132
+ * ```json
9133
+ * {
9134
+ * "errNo": 103,
9135
+ * "errMsg": "feature not support"
9136
+ * }
9137
+ * ```
9138
+ * @errorCode common | 102 | Android,iOS
9139
+ * @errorCode errNo | 103 | feature not support | Android | 当前容器类型不支持设置全局上下文 | 请在支持的容器(页面、卡片或 Worker)环境中调用。
9140
+ * @errorCode errNo | 104 | invalid parameter | iOS | 传入的参数结构非法,无法解析 | 检查传入的参数结构后重试。
9141
+ * @platformNote Android | 当前容器类型不受支持返回 103;其他失败统一返回 102。
9142
+ * @platformNote iOS | 参数结构非法返回 104;其他失败统一返回 102。
7952
9143
  *
7953
9144
  * @internal
7954
9145
  */
@@ -7984,6 +9175,8 @@ export declare interface SetAdditionalContextParams {
7984
9175
  * @since 0.0.25
7985
9176
  * @contractStatus conflict | 豆包 iOS 未提供设置 MTU 能力,仅 Android 可调用
7986
9177
  * @contractMismatch blocking | platform | 设置 MTU | iOS | 双端均可设置 BLE MTU | 豆包 iOS 的 setBLEMTU 固定返回不支持 | iOS 上调用无法设置 MTU | packages/open-api/src/device/bluetooth/bluetooth.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/SetBLEMTUMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeDeviceBluetoothMethods.swift | 补齐豆包 iOS 设置 MTU 能力
9178
+ * @containerSupport Page | supported
9179
+ * @containerSupport Widget | unsupported
7987
9180
  * @platformSupport Android | supported | 支持设置 BLE MTU
7988
9181
  * @platformSupport iOS | unsupported | 豆包 iOS 未实现设置 MTU,调用返回不支持
7989
9182
  * @platformSupport PC | unsupported | 暂不支持
@@ -8042,6 +9235,8 @@ export declare interface SetBLEMTUResult {
8042
9235
  * @returns 不包含字段的结果对象。
8043
9236
  * @since 0.0.20
8044
9237
  * @contractStatus verified | 设置剪贴板的成功语义已与 Android、iOS 当前实现对齐
9238
+ * @containerSupport Page | supported
9239
+ * @containerSupport Widget | supported
8045
9240
  * @platformSupport Android | supported | 支持写入剪贴板
8046
9241
  * @platformSupport iOS | supported | 支持写入剪贴板
8047
9242
  * @platformSupport PC | unsupported | 暂不支持
@@ -8054,7 +9249,16 @@ export declare interface SetBLEMTUResult {
8054
9249
  * ```json
8055
9250
  * {}
8056
9251
  * ```
8057
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认豆包是否提供剪贴板能力
9252
+ * @errorExample
9253
+ * ```json
9254
+ * {
9255
+ * "errNo": 103,
9256
+ * "errMsg": "feature not support"
9257
+ * }
9258
+ * ```
9259
+ * @errorCode common | 102 | Android,iOS
9260
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 当前豆包版本或运行环境未提供剪贴板写入能力 | 在支持剪贴板能力的豆包版本中调用。
9261
+ * @errorCode errNo | 106 | system permission denied | Android | 写入后系统未授予剪贴板访问权限,写入未生效 | 引导用户在系统设置中开启剪贴板相关权限后重试。
8058
9262
  *
8059
9263
  * @public
8060
9264
  */
@@ -8080,6 +9284,8 @@ export declare interface SetClipboardDataParams {
8080
9284
  * @since 0.0.25
8081
9285
  * @contractStatus verified | 设置屏幕常亮的成功语义已与 Android、iOS 当前实现对齐;双端实现机制不同但公开类型已准确表达
8082
9286
  * @contractMismatch non-blocking | behavior | 常亮生效范围 | Android,iOS | 设置屏幕保持常亮 | Android 通过窗口 keepScreenOn 标志控制,iOS 通过 isIdleTimerDisabled 引用计数控制并随页面销毁自动恢复 | 常亮的生效范围与自动恢复行为在双端不同 | packages/open-api/src/device/screen/set-keep-screen-on.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/system/AIBridgeScreenMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeScreenMethods.swift | 统一双端常亮的生效范围与恢复策略
9287
+ * @containerSupport Page | supported
9288
+ * @containerSupport Widget | unsupported
8083
9289
  * @platformSupport Android | supported | 支持设置屏幕常亮
8084
9290
  * @platformSupport iOS | supported | 支持设置屏幕常亮
8085
9291
  * @platformSupport PC | unsupported | 暂不支持
@@ -8088,11 +9294,12 @@ export declare interface SetClipboardDataParams {
8088
9294
  * @precondition All | 无额外前置条件
8089
9295
  * @usageNote All | 不再需要常亮时应主动将 keepScreenOn 设为 false,避免额外功耗
8090
9296
  * @platformNote iOS | 页面销毁后常亮状态会自动恢复
9297
+ * @platformNote iOS | 设置常亮恒返回成功,无失败错误码
8091
9298
  * @resultExample
8092
9299
  * ```json
8093
9300
  * {}
8094
9301
  * ```
8095
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息重试
9302
+ * @errorCode common | 102 | Android
8096
9303
  *
8097
9304
  * @public
8098
9305
  */
@@ -8125,6 +9332,8 @@ export declare interface SetKeepScreenOnParams {
8125
9332
  *
8126
9333
  * @since 0.0.17
8127
9334
  * @contractStatus verified | 公开参数、写入语义及 Android、iOS 错误字段已核对一致。
9335
+ * @containerSupport Page | supported
9336
+ * @containerSupport Widget | supported
8128
9337
  * @platformSupport Android | supported | 支持按智能服务维度写入本地缓存。
8129
9338
  * @platformSupport iOS | supported | 支持按智能服务维度写入本地缓存。
8130
9339
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -8174,6 +9383,8 @@ export declare interface SetStorageParams<TData = unknown> {
8174
9383
  *
8175
9384
  * @since 0.0.19
8176
9385
  * @contractStatus verified | 公开参数、写入语义及 Android、iOS 错误字段已核对一致。
9386
+ * @containerSupport Page | supported
9387
+ * @containerSupport Widget | supported
8177
9388
  * @platformSupport Android | supported | 支持按智能服务维度同步写入本地缓存。
8178
9389
  * @platformSupport iOS | supported | 支持按智能服务维度同步写入本地缓存。
8179
9390
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -8217,6 +9428,8 @@ export declare function setStorageSync<TData = unknown>(params: SetStorageParams
8217
9428
  * @since 0.0.25
8218
9429
  * @contractStatus conflict | 豆包 Android 未提供设置预设列表能力,仅 iOS 可调用
8219
9430
  * @contractMismatch blocking | platform | 设置 Wi-Fi 预设列表 | Android | 双端均可设置预设 Wi-Fi 列表 | 豆包 Android 的 setWifiList 固定返回失败(setWifiList is iOS only) | Android 上调用无法设置预设列表 | packages/open-api/src/device/wifi/wifi.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/wifi/SetWifiListMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/Wifi/AIBridgeSetWifiListMethod.swift | 补齐豆包 Android 设置预设列表能力
9431
+ * @containerSupport Page | supported
9432
+ * @containerSupport Widget | unsupported
8220
9433
  * @platformSupport Android | unsupported | 豆包 Android 未实现设置预设列表,调用固定失败
8221
9434
  * @platformSupport iOS | supported | 支持设置 Wi-Fi 预设列表
8222
9435
  * @platformSupport PC | unsupported | 暂不支持
@@ -8228,7 +9441,17 @@ export declare function setStorageSync<TData = unknown>(params: SetStorageParams
8228
9441
  * ```json
8229
9442
  * {}
8230
9443
  * ```
8231
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | Android 不要调用该 API,iOS 根据返回的错误信息重试
9444
+ * @errorExample
9445
+ * ```json
9446
+ * {
9447
+ * "errNo": 1401001,
9448
+ * "errMsg": "wifi is not initialized"
9449
+ * }
9450
+ * ```
9451
+ * @errorCode common | 102 | iOS
9452
+ * @errorCode errNo | 103 | feature not support | Android | 该 API 为 iOS 特有,Android 调用固定失败 | 不要在 Android 调用该 API
9453
+ * @errorCode errNo | 1401001 | wifi is not initialized | iOS | 调用前未先调用 startWifi 完成初始化 | 先调用 startWifi 再设置预设列表
9454
+ * @platformNote Android | 固定返回 103(该能力仅 iOS);iOS 未初始化返回 1401001,其他失败统一返回 102。
8232
9455
  *
8233
9456
  * @public
8234
9457
  */
@@ -8260,6 +9483,8 @@ export declare interface SetWifiListParams {
8260
9483
  *
8261
9484
  * @since 0.0.26
8262
9485
  * @contractStatus verified | 公开参数、返回 tapIndex 及 Android、iOS 行为已核对一致。
9486
+ * @containerSupport Page | supported
9487
+ * @containerSupport Widget | supported
8263
9488
  * @platformSupport Android | supported | 支持展示操作菜单。
8264
9489
  * @platformSupport iOS | supported | 支持展示操作菜单。
8265
9490
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -8273,7 +9498,16 @@ export declare interface SetWifiListParams {
8273
9498
  * "tapIndex": 0
8274
9499
  * }
8275
9500
  * ```
8276
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
9501
+ * @errorExample
9502
+ * ```json
9503
+ * {
9504
+ * "errNo": 114,
9505
+ * "errMsg": "operation cancelled"
9506
+ * }
9507
+ * ```
9508
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | itemList 为空数组 | 传入至少一个菜单项后重试。
9509
+ * @errorCode errNo | 114 | operation cancelled | Android,iOS | 用户点击 Cancel 按钮或点击蒙层关闭操作菜单 | 用户主动取消,按需静默处理。
9510
+ * @errorCode common | 102 | Android,iOS
8277
9511
  *
8278
9512
  * @public
8279
9513
  */
@@ -8340,6 +9574,8 @@ export declare interface ShowActionSheetResult {
8340
9574
  * @since 0.0.36
8341
9575
  * @contractStatus conflict | 参数校验错误码双端一致,但 provider 不可用与三按钮场景的错误处理在 Android、iOS 上不一致。
8342
9576
  * @contractMismatch blocking | error | provider 不可用与三按钮场景 | Android,iOS | 同一异常场景返回一致的失败结果 | iOS 在 provider 不可用或不支持三按钮时返回 errNo 103 失败,Android 在 provider 不可用时返回 action=cancel、source=hostUnavailable 的成功结果,且不检测三按钮能力 | 调用方无法用统一逻辑处理弹窗不可用场景 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/bottomsheet/ShowBottomSheetMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Doubao/AIBridgeShowBottomSheetMethod.swift | 统一双端 provider 不可用与三按钮场景的错误返回
9577
+ * @containerSupport Page | supported
9578
+ * @containerSupport Widget | supported
8343
9579
  * @platformSupport Android | supported | 支持展示 Native 底部弹窗。
8344
9580
  * @platformSupport iOS | supported | 支持展示 Native 底部弹窗。
8345
9581
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -8355,8 +9591,16 @@ export declare interface ShowActionSheetResult {
8355
9591
  * "role": "agreeMain"
8356
9592
  * }
8357
9593
  * ```
8358
- * @errorCode common | 104 | Android,iOS
8359
- * @errorCode common | 103 | iOS
9594
+ * @errorExample
9595
+ * ```json
9596
+ * {
9597
+ * "errNo": 104,
9598
+ * "errMsg": "invalid parameter"
9599
+ * }
9600
+ * ```
9601
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | title 或 content 为空、content 含被拦截的标签/事件属性/危险链接、buttons 数量不在 1-3 范围;iOS 还会在按钮语义重复或按钮文案为空时返回 | 修正参数后重试。
9602
+ * @errorCode errNo | 103 | feature not support | iOS | 豆包底部弹窗能力不可用,或按钮数为 3 时当前 provider 不支持三按钮 | 降级到自定义弹窗;同场景 Android 返回 action=cancel、source=hostUnavailable 的成功结果,请一并做降级处理。
9603
+ * @platformNote iOS | provider 不可用或不支持三按钮时返回 errNo 103 失败;Android 在 provider 不可用时返回 action=cancel、source=hostUnavailable 的成功结果,且不校验三按钮能力。
8360
9604
  *
8361
9605
  * @public
8362
9606
  */
@@ -8403,6 +9647,8 @@ export declare type ShowBottomSheetResult = BottomSheetButtonClickResult | Botto
8403
9647
  *
8404
9648
  * @since 0.0.26
8405
9649
  * @contractStatus verified | 无参数、无返回字段,与 Android、iOS 实现一致。
9650
+ * @containerSupport Page | supported
9651
+ * @containerSupport Widget | unsupported
8406
9652
  * @platformSupport Android | supported | 支持展示 loading 提示框。
8407
9653
  * @platformSupport iOS | supported | 支持展示 loading 提示框。
8408
9654
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -8410,7 +9656,7 @@ export declare type ShowBottomSheetResult = BottomSheetButtonClickResult | Botto
8410
9656
  * @permission none | - | none | Android,iOS | 无需额外权限
8411
9657
  * @precondition All | 无额外前置条件
8412
9658
  * @usageNote All | loading 展示后需调用 hideLoading 手动关闭。
8413
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
9659
+ * @errorCode common | 102 | Android,iOS
8414
9660
  *
8415
9661
  * @public
8416
9662
  */
@@ -8444,26 +9690,27 @@ export declare interface ShowLoadingParams {
8444
9690
  * ```
8445
9691
  *
8446
9692
  * @since 0.0.26
8447
- * @contractStatus verified | 公开参数、返回动作及 Android、iOS 行为已核对一致;按钮默认文案存在平台差异,已在字段约束中说明。
8448
- * @contractMismatch non-blocking | default | confirmText、cancelText | Android,iOS | 省略时使用统一默认文案 | Android 默认 confirm/cancel,iOS 默认 OK/Cancel | 未传文案时双端按钮文字不同,公开可选类型可承载 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/ui/ShowModalMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/UI/AIBridgeShowModalMethod.swift | 统一双端默认按钮文案
9693
+ * @contractStatus verified | 参数、返回 action/content 及 Android、iOS 行为已核对一致;HarmonyOS 当前不提供实现。
9694
+ * @containerSupport Page | supported
9695
+ * @containerSupport Widget | supported
8449
9696
  * @platformSupport Android | supported | 支持展示模态对话框。
8450
9697
  * @platformSupport iOS | supported | 支持展示模态对话框。
8451
9698
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
8452
9699
  * @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
8453
9700
  * @permission none | - | none | Android,iOS | 无需额外权限
8454
9701
  * @precondition All | 无额外前置条件
8455
- * @usageNote All | content 必填;仅当 showCancel 为 true 时展示取消按钮,仅当 tapMaskToDismiss 为 true 时点击蒙层可关闭。
9702
+ * @usageNote All | 仅当 showCancel 为 true 时展示取消按钮;仅当 tapMaskToDismiss 为 true 时点击蒙层可关闭;editable 为 true 且用户确认时返回输入 content。
8456
9703
  * @resultExample
8457
9704
  * ```json
8458
9705
  * {
8459
9706
  * "action": "confirm"
8460
9707
  * }
8461
9708
  * ```
8462
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
9709
+ * @errorCode common | 102 | Android,iOS
8463
9710
  *
8464
9711
  * @public
8465
9712
  */
8466
- export declare const showModal: (params: ShowModalParams) => Promise<ShowModalResult>;
9713
+ export declare const showModal: (params?: ShowModalParams | undefined) => Promise<ShowModalResult>;
8467
9714
 
8468
9715
  /**
8469
9716
  * 显示模态对话框的参数。
@@ -8476,25 +9723,50 @@ export declare interface ShowModalParams {
8476
9723
  * @default -
8477
9724
  */
8478
9725
  title?: string;
8479
- /** 模态对话框的内容。 */
8480
- content: string;
9726
+ /**
9727
+ * 模态对话框的内容。
9728
+ * @default -
9729
+ */
9730
+ content?: string;
8481
9731
  /**
8482
9732
  * 是否显示取消按钮。
8483
9733
  * @default true
8484
9734
  */
8485
9735
  showCancel?: boolean;
8486
9736
  /**
8487
- * 取消按钮的文字,省略时使用平台默认文案。
8488
- * @default -
8489
- * @constraint Android 默认文案为“cancel”,iOS 默认文案为“Cancel”,需统一时请显式传入。
9737
+ * 取消按钮的文字。
9738
+ * @default 取消
9739
+ * @constraint 最多 4 个字符。
8490
9740
  */
8491
9741
  cancelText?: string;
8492
9742
  /**
8493
- * 确认按钮的文字,省略时使用平台默认文案。
8494
- * @default -
8495
- * @constraint Android 默认文案为“confirm”,iOS 默认文案为“OK”,需统一时请显式传入。
9743
+ * 取消按钮的文字颜色。
9744
+ * @default #000000
9745
+ * @constraint 必须是 16 进制格式的颜色字符串。
9746
+ */
9747
+ cancelColor?: string;
9748
+ /**
9749
+ * 确认按钮的文字。
9750
+ * @default 确定
9751
+ * @constraint 最多 4 个字符。
8496
9752
  */
8497
9753
  confirmText?: string;
9754
+ /**
9755
+ * 确认按钮的文字颜色。
9756
+ * @default #F85959
9757
+ * @constraint 必须是 16 进制格式的颜色字符串。
9758
+ */
9759
+ confirmColor?: string;
9760
+ /**
9761
+ * 是否显示输入框。
9762
+ * @default false
9763
+ */
9764
+ editable?: boolean;
9765
+ /**
9766
+ * 显示输入框时的提示文本。
9767
+ * @default -
9768
+ */
9769
+ placeholderText?: string;
8498
9770
  /**
8499
9771
  * 是否允许点击蒙层关闭对话框。
8500
9772
  * @default true
@@ -8510,22 +9782,17 @@ export declare interface ShowModalParams {
8510
9782
  export declare interface ShowModalResult {
8511
9783
  /** 用户点击的动作。 */
8512
9784
  action: 'confirm' | 'cancel' | 'mask';
9785
+ /** `editable` 为 true 时,用户点击确认后输入的文本。 */
9786
+ content?: string;
8513
9787
  }
8514
9788
 
8515
9789
  /**
8516
9790
  * 显示 Toast 提示。
8517
9791
  *
8518
- * 参数 `options` 包含以下字段:
8519
- * - `message`:提示的内容。
8520
- * - `type`:Toast 的类型,可选值为 'default'、'success'、'error' 或 'warning'。
8521
- * - `duration`:提示的延迟时间,单位毫秒,默认为 2000。
8522
- * - `icon`:图标,可选值为 'success'、'error'、'warn'。
8523
- * - `customIcon`:自定义图标的 URL 或 base64 字符串。
8524
- *
8525
9792
  * @summary 显示 Toast 提示。
8526
9793
  * @returns 返回一个 Promise,在 Toast 显示结束时 resolve。
8527
9794
  * @remarks
8528
- * duration 和 icon 可控制提示表现。
9795
+ * Android 默认显示 3000 毫秒,iOS 默认显示 2000 毫秒;需要双端一致时请显式传入 `duration`。
8529
9796
  * @example
8530
9797
  * ```typescript
8531
9798
  * import { showToast } from '@doubao-dev/framework/api';
@@ -8551,6 +9818,8 @@ export declare interface ShowModalResult {
8551
9818
  * @since 0.0.9
8552
9819
  * @contractStatus conflict | 公开参数 customIcon 在 Android、iOS 均未渲染,与其可自定义图标的定义冲突。
8553
9820
  * @contractMismatch blocking | parameter | customIcon | Android,iOS | 传入 URL 或 base64 展示自定义图标 | Android、iOS 均只按 icon/type 渲染内置图标,不加载 customIcon | 依赖 customIcon 展示图标的调用不会生效 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/ui/ShowToastMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/UI/AIBridgeShowToastMethod.swift; flow_ios/flow_iOS/Modules/FlowApplet/Sources/AIBridge/FlowAIBridgeService.swift | 补齐豆包双端 customIcon 渲染,或从公开参数中移除 customIcon
9821
+ * @containerSupport Page | supported
9822
+ * @containerSupport Widget | supported
8554
9823
  * @platformSupport Android | supported | 支持展示 Toast 提示。
8555
9824
  * @platformSupport iOS | supported | 支持展示 Toast 提示。
8556
9825
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -8562,7 +9831,17 @@ export declare interface ShowModalResult {
8562
9831
  * ```json
8563
9832
  * {}
8564
9833
  * ```
8565
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
9834
+ * @errorExample
9835
+ * ```json
9836
+ * {
9837
+ * "errNo": 104,
9838
+ * "errMsg": "invalid parameter"
9839
+ * }
9840
+ * ```
9841
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | message 为空;iOS 还会在 icon 取值非法或入参无法解析时返回(type 由前端归一化为合法值,非法 type 场景不会触发) | 修正参数后重试。
9842
+ * @errorCode errNo | 103 | feature not support | iOS | 豆包 UIService 未实现,无法展示 Toast | 降级到其他提示方式。
9843
+ * @errorCode common | 102 | Android
9844
+ * @platformNote iOS | 参数校验失败统一返回 errNo 104;UIService 缺失时返回 errNo 103。Android 参数校验失败返回 errNo 104,豆包页面运行上下文缺失返回 errNo 102。
8566
9845
  *
8567
9846
  * @public
8568
9847
  * */
@@ -8579,8 +9858,8 @@ export declare interface ShowToastParams {
8579
9858
  type?: 'default' | 'success' | 'error' | 'warning';
8580
9859
  /**
8581
9860
  * 提示的持续时间,单位毫秒。
8582
- * @default -
8583
- * @constraint Android 默认 3000,iOS 默认 2000,需双端一致时请显式传入。
9861
+ * @default Android 3000,iOS 2000
9862
+ * @constraint 需双端保持一致时请显式传入。
8584
9863
  */
8585
9864
  duration?: number;
8586
9865
  /**
@@ -8601,7 +9880,7 @@ export declare interface ShowToastParams {
8601
9880
  * @param params - `createSignOrder` 返回的平台签约订单号。
8602
9881
  * @returns 签约页面流程正常返回时解析为空对象;该结果不代表签约成功。
8603
9882
  * @remarks
8604
- * 如果用户尚未绑定抖音账号,宿主可能先拉起账号绑定流程,再继续展示签约页面。
9883
+ * 如果用户尚未绑定抖音账号,豆包可能先拉起账号绑定流程,再继续展示签约页面。
8605
9884
  *
8606
9885
  * 用户的最终签约状态必须以业务服务端查询签约单详情或收到的签约结果回调为准。
8607
9886
  * 业务服务端还需要维护业务用户与签约 ID 的对应关系。
@@ -8631,6 +9910,8 @@ export declare interface ShowToastParams {
8631
9910
  * @since 0.0.28
8632
9911
  * @contractStatus verified | 成功解析为空对象,与 Android、iOS 一致;失败通过 Promise reject,业务错误在错误对象的 data 字段。公开联合类型的失败分支不会作为 resolve 值出现,仅作后续对齐项。
8633
9912
  * @contractMismatch non-blocking | return | SignResult | Android,iOS | 返回类型声明为 SignSuccessResult 与 SignFailResult 的联合,暗示失败结果可作为 resolve 值 | 双端成功时 resolve 空对象,失败时通过 Promise reject 返回,业务错误(code、errNo、errMsg、errLogId)在错误对象的 data 字段 | 调用方误以为可对 await 结果做失败分支判断 | packages/open-api/src/open/payment/sign.ts; packages/bridge-base/src/client-api.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/payment/SignMethod.kt | 将公开返回类型收敛为成功结果,失败改由错误对象表达
9913
+ * @containerSupport Page | supported
9914
+ * @containerSupport Widget | supported
8634
9915
  * @platformSupport Android | supported | 支持拉起签约流程。
8635
9916
  * @platformSupport iOS | supported | 支持拉起签约流程。
8636
9917
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -8643,8 +9924,18 @@ export declare interface ShowToastParams {
8643
9924
  * ```json
8644
9925
  * {}
8645
9926
  * ```
8646
- * @errorCode none | - | - | Android,iOS | 无稳定的顶层 errNo/errMsg;调用失败时 Promise reject,业务错误(code、errNo、errMsg、errLogId)在错误对象的 data 字段 | 通过 catch 捕获并读取 e.data 排查
9927
+ * @errorExample
9928
+ * ```json
9929
+ * {
9930
+ * "errNo": 114,
9931
+ * "errMsg": "operation cancelled"
9932
+ * }
9933
+ * ```
9934
+ * @errorCode common | 102 | Android,iOS
9935
+ * @errorCode common | 103 | Android,iOS
9936
+ * @errorCode errNo | 114 | operation cancelled | Android | 用户在签约收银台中取消了签约操作 | 用户需要时可再次调用 `sign` 重新发起签约。
8647
9937
  * @platformNote Android | 需在前台可见的 Activity 中调用,应用退至后台或无有效页面时会返回失败。
9938
+ * @platformNote Android | 用户主动取消签约时返回顶层 errNo 114(operation cancelled);iOS 在该场景不返回顶层专属 errNo。
8648
9939
  * @knownIssue All | 失败结果不会作为 await 的返回值,需通过 catch 捕获并从错误对象的 data 字段读取 code、errNo、errMsg、errLogId。
8649
9940
  *
8650
9941
  * @public
@@ -8699,7 +9990,7 @@ export declare interface SocketTask {
8699
9990
  /**
8700
9991
  * 表示 Socket 正在连接。
8701
9992
  *
8702
- * `connectSocket` 刚返回且宿主尚未完成握手时通常处于该状态。
9993
+ * `connectSocket` 刚返回且豆包客户端尚未完成握手时通常处于该状态。
8703
9994
  */
8704
9995
  readonly CONNECTING: 0;
8705
9996
  /**
@@ -8711,7 +10002,7 @@ export declare interface SocketTask {
8711
10002
  /**
8712
10003
  * 表示 Socket 连接关闭中。
8713
10004
  *
8714
- * 调用 {@link SocketTask.close} 后、本地等待宿主侧完成关闭流程时通常处于该状态。
10005
+ * 调用 {@link SocketTask.close} 后,等待豆包客户端完成关闭流程时通常处于该状态。
8715
10006
  */
8716
10007
  readonly CLOSING: 2;
8717
10008
  /**
@@ -8724,7 +10015,7 @@ export declare interface SocketTask {
8724
10015
  * 当前 Socket 连接状态 code。
8725
10016
  *
8726
10017
  * 可与 `CONNECTING`、`OPEN`、`CLOSING`、`CLOSED` 常量比较。
8727
- * 如果因为参数错误等原因导致连接请求没有被宿主成功创建,则为 `undefined`。
10018
+ * 如果因为参数错误等原因导致豆包客户端没有成功创建连接,则为 `undefined`。
8728
10019
  */
8729
10020
  readonly readyState: number | undefined;
8730
10021
  /**
@@ -8776,7 +10067,7 @@ export declare interface SocketTask {
8776
10067
  /**
8777
10068
  * WebSocket 关闭事件。
8778
10069
  *
8779
- * 当前连接被主动关闭、服务端关闭或宿主侧因异常回收连接时触发。
10070
+ * 当前连接被主动关闭、服务端关闭或豆包客户端因异常回收连接时触发。
8780
10071
  * 触发后 `readyState` 会变为 `SocketTask.CLOSED`,该 `SocketTask` 不应再继续发送数据。
8781
10072
  *
8782
10073
  * @public
@@ -8785,31 +10076,31 @@ export declare interface SocketTaskCloseEvent {
8785
10076
  /**
8786
10077
  * 关闭状态码。
8787
10078
  *
8788
- * 可能来自调用 {@link SocketTask.close} 时传入的 `code`,也可能来自服务端或宿主侧。
10079
+ * 可能来自调用 {@link SocketTask.close} 时传入的 `code`,也可能来自服务端或豆包客户端。
8789
10080
  */
8790
10081
  code?: number;
8791
10082
  /**
8792
10083
  * 关闭原因。
8793
10084
  *
8794
- * 可能来自调用 {@link SocketTask.close} 时传入的 `reason`,也可能来自服务端或宿主侧。
10085
+ * 可能来自调用 {@link SocketTask.close} 时传入的 `reason`,也可能来自服务端或豆包客户端。
8795
10086
  */
8796
10087
  reason?: string;
8797
10088
  /**
8798
10089
  * 错误信息。
8799
10090
  *
8800
- * 非正常关闭时宿主侧可能通过该字段补充失败原因;正常关闭时通常为空。
10091
+ * 非正常关闭时豆包客户端可能通过该字段补充失败原因;正常关闭时通常为空。
8801
10092
  */
8802
10093
  errMsg?: string;
8803
10094
  /**
8804
10095
  * 当前连接使用的网络传输层协议。
8805
10096
  *
8806
- * 该字段由宿主侧返回,部分运行环境可能不提供。
10097
+ * 该字段由豆包客户端返回,部分运行环境可能不提供。
8807
10098
  */
8808
10099
  protocolType?: string;
8809
10100
  /**
8810
- * 宿主侧使用的 WebSocket 实现类型。
10101
+ * 豆包客户端使用的 WebSocket 实现类型。
8811
10102
  *
8812
- * 该字段由宿主侧返回,部分运行环境可能不提供。
10103
+ * 该字段由豆包客户端返回,部分运行环境可能不提供。
8813
10104
  */
8814
10105
  socketType?: string;
8815
10106
  }
@@ -8826,10 +10117,10 @@ export declare interface SocketTaskCloseParams {
8826
10117
  /**
8827
10118
  * 关闭连接状态码。
8828
10119
  *
8829
- * 不传时由宿主侧按正常关闭处理,通常等价于 `1000`。
10120
+ * 不传时由豆包客户端按正常关闭处理,通常等价于 `1000`。
8830
10121
  * 常见值包括:
8831
10122
  * - `1000`: 正常关闭;
8832
- * - `1001`: 因页面进入后台、宿主回收连接等原因关闭。
10123
+ * - `1001`: 因页面进入后台、豆包客户端回收连接等原因关闭。
8833
10124
  */
8834
10125
  code?: number;
8835
10126
  /**
@@ -8852,7 +10143,7 @@ export declare interface SocketTaskErrorEvent {
8852
10143
  /**
8853
10144
  * 错误信息。
8854
10145
  *
8855
- * 由前端参数校验、编码过程或宿主侧返回的失败原因组成,可直接用于日志上报。
10146
+ * 由前端参数校验、编码过程或豆包客户端返回的失败原因组成,可直接用于日志上报。
8856
10147
  */
8857
10148
  errMsg: string;
8858
10149
  }
@@ -8878,13 +10169,13 @@ export declare interface SocketTaskMessageEvent {
8878
10169
  /**
8879
10170
  * 当前消息所属连接使用的协议。
8880
10171
  *
8881
- * 该字段由宿主侧返回,部分运行环境可能不提供。
10172
+ * 该字段由豆包客户端返回,部分运行环境可能不提供。
8882
10173
  */
8883
10174
  protocolType?: string;
8884
10175
  /**
8885
- * 宿主侧使用的 WebSocket 实现类型。
10176
+ * 豆包客户端使用的 WebSocket 实现类型。
8886
10177
  *
8887
- * 该字段由宿主侧返回,部分运行环境可能不提供。
10178
+ * 该字段由豆包客户端返回,部分运行环境可能不提供。
8888
10179
  */
8889
10180
  socketType?: string;
8890
10181
  }
@@ -8892,7 +10183,7 @@ export declare interface SocketTaskMessageEvent {
8892
10183
  /**
8893
10184
  * WebSocket 连接成功事件。
8894
10185
  *
8895
- * 当宿主侧完成 WebSocket 握手并进入 open 状态后触发。
10186
+ * 当豆包客户端完成 WebSocket 握手并进入 open 状态后触发。
8896
10187
  * 收到该事件后,调用方可以开始通过 {@link SocketTask.send} 发送数据。
8897
10188
  *
8898
10189
  * @public
@@ -8908,13 +10199,13 @@ export declare interface SocketTaskOpenEvent {
8908
10199
  /**
8909
10200
  * 当前连接使用的网络传输层协议。
8910
10201
  *
8911
- * 该字段由宿主侧返回,部分运行环境可能不提供。
10202
+ * 该字段由豆包客户端返回,部分运行环境可能不提供。
8912
10203
  */
8913
10204
  protocolType?: string;
8914
10205
  /**
8915
- * 宿主侧使用的 WebSocket 实现类型。
10206
+ * 豆包客户端使用的 WebSocket 实现类型。
8916
10207
  *
8917
- * 可能的值由宿主实现决定,例如传统 WebSocket 实现或宿主网络库实现;
10208
+ * 可能的值由豆包客户端实现决定,例如系统 WebSocket 实现或豆包网络库实现;
8918
10209
  * 部分运行环境可能不提供。
8919
10210
  */
8920
10211
  socketType?: string;
@@ -8933,7 +10224,7 @@ export declare interface SocketTaskSendParams {
8933
10224
  * 需要发送给服务端的数据。
8934
10225
  *
8935
10226
  * - 传入 `string` 时按文本消息发送;
8936
- * - 传入 `ArrayBuffer` 时按二进制消息发送,内部会编码后交给宿主侧处理。
10227
+ * - 传入 `ArrayBuffer` 时按二进制消息发送,内部会编码后交给豆包客户端处理。
8937
10228
  *
8938
10229
  * 建议只在 `onOpen` 回调触发后调用 `send`,此时 `readyState` 通常为 `SocketTask.OPEN`。
8939
10230
  */
@@ -8954,6 +10245,8 @@ export declare interface SocketTaskSendParams {
8954
10245
  * @returns 不包含字段的结果对象。
8955
10246
  * @since 0.0.25
8956
10247
  * @contractStatus verified | 开始监听加速度的入参与成功语义已与 Android、iOS 当前实现对齐
10248
+ * @containerSupport Page | supported
10249
+ * @containerSupport Widget | unsupported
8957
10250
  * @platformSupport Android | supported | 支持开始监听加速度
8958
10251
  * @platformSupport iOS | supported | 支持开始监听加速度
8959
10252
  * @platformSupport PC | unsupported | 暂不支持
@@ -8965,7 +10258,15 @@ export declare interface SocketTaskSendParams {
8965
10258
  * ```json
8966
10259
  * {}
8967
10260
  * ```
8968
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认设备是否支持加速度传感器
10261
+ * @errorExample
10262
+ * ```json
10263
+ * {
10264
+ * "errNo": 103,
10265
+ * "errMsg": "feature not support"
10266
+ * }
10267
+ * ```
10268
+ * @errorCode common | 102 | Android,iOS
10269
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 当前设备不支持加速度传感器或无法注册监听 | 在具备加速度传感器的设备上调用,或提前提示用户设备不支持。
8969
10270
  *
8970
10271
  * @public
8971
10272
  */
@@ -9001,6 +10302,8 @@ export declare interface StartAccelerometerParams {
9001
10302
  * @since 0.0.25
9002
10303
  * @contractStatus conflict | ignoreBluetoothAvailable 仅在 iOS 生效,Android 不消费该参数
9003
10304
  * @contractMismatch blocking | parameter | ignoreBluetoothAvailable | Android | 忽略蓝牙可用性校验后继续搜索 | Android 不读取该字段,蓝牙不可用时仍会失败 | Android 调用方设置该参数不会生效 | packages/open-api/src/device/ibeacon/beacon.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/StartBeaconDiscoveryMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeDeviceBeaconMethods.swift | 补齐 Android 对 ignoreBluetoothAvailable 的处理或收敛为 iOS 特有参数
10305
+ * @containerSupport Page | supported
10306
+ * @containerSupport Widget | unsupported
9004
10307
  * @platformSupport Android | supported | 支持搜索附近的 iBeacon
9005
10308
  * @platformSupport iOS | supported | 支持搜索附近的 iBeacon
9006
10309
  * @platformSupport PC | unsupported | 暂不支持
@@ -9065,6 +10368,8 @@ export declare interface StartBeaconDiscoveryParams {
9065
10368
  * @returns 不包含字段的结果对象。
9066
10369
  * @since 0.0.25
9067
10370
  * @contractStatus verified | 搜索蓝牙设备的入参与返回结构已与 Android、iOS 当前实现对齐
10371
+ * @containerSupport Page | supported
10372
+ * @containerSupport Widget | unsupported
9068
10373
  * @platformSupport Android | supported | 支持搜索附近蓝牙设备
9069
10374
  * @platformSupport iOS | supported | 支持搜索附近蓝牙设备
9070
10375
  * @platformSupport PC | unsupported | 暂不支持
@@ -9134,6 +10439,8 @@ export declare interface StartBluetoothDevicesDiscoveryParams {
9134
10439
  * @since 0.0.25
9135
10440
  * @contractStatus verified | 开始监听罗盘的成功语义已与 Android、iOS 当前实现对齐;双端回调频率策略不同但不影响公开类型
9136
10441
  * @contractMismatch non-blocking | behavior | 回调频率策略 | Android,iOS | 按监听频率持续回调罗盘方向 | Android 将频率作为采样速率,iOS 将其作为回调节流阈值 | 相同频率下双端实际回调节奏不同 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/AIBridgeCompassMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeCompassMethods.swift | 统一双端监听频率的物理含义
10442
+ * @containerSupport Page | supported
10443
+ * @containerSupport Widget | unsupported
9137
10444
  * @platformSupport Android | supported | 支持开始监听罗盘
9138
10445
  * @platformSupport iOS | supported | 支持开始监听罗盘
9139
10446
  * @platformSupport PC | unsupported | 暂不支持
@@ -9145,7 +10452,15 @@ export declare interface StartBluetoothDevicesDiscoveryParams {
9145
10452
  * ```json
9146
10453
  * {}
9147
10454
  * ```
9148
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认设备是否支持罗盘传感器
10455
+ * @errorExample
10456
+ * ```json
10457
+ * {
10458
+ * "errNo": 103,
10459
+ * "errMsg": "feature not support"
10460
+ * }
10461
+ * ```
10462
+ * @errorCode common | 102 | Android,iOS
10463
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 当前设备不支持罗盘传感器或无法注册监听 | 在具备罗盘传感器的设备上调用,或提前提示用户设备不支持。
9149
10464
  *
9150
10465
  * @public
9151
10466
  */
@@ -9165,6 +10480,8 @@ export declare const startCompass: (params?: {} | undefined) => Promise<object>;
9165
10480
  * @returns 不包含字段的结果对象。
9166
10481
  * @since 0.0.25
9167
10482
  * @contractStatus verified | 开始监听设备方向的入参与成功语义已与 Android、iOS 当前实现对齐
10483
+ * @containerSupport Page | supported
10484
+ * @containerSupport Widget | unsupported
9168
10485
  * @platformSupport Android | supported | 支持开始监听设备方向变化
9169
10486
  * @platformSupport iOS | supported | 支持开始监听设备方向变化
9170
10487
  * @platformSupport PC | unsupported | 暂不支持
@@ -9176,7 +10493,15 @@ export declare const startCompass: (params?: {} | undefined) => Promise<object>;
9176
10493
  * ```json
9177
10494
  * {}
9178
10495
  * ```
9179
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认设备是否支持方向传感器
10496
+ * @errorExample
10497
+ * ```json
10498
+ * {
10499
+ * "errNo": 103,
10500
+ * "errMsg": "feature not support"
10501
+ * }
10502
+ * ```
10503
+ * @errorCode common | 102 | Android,iOS
10504
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 当前设备不支持方向传感器或无法注册监听 | 在具备方向传感器的设备上调用,或提前提示用户设备不支持。
9180
10505
  *
9181
10506
  * @public
9182
10507
  */
@@ -9211,6 +10536,8 @@ export declare interface StartDeviceMotionListeningParams {
9211
10536
  * @returns 不包含字段的结果对象。
9212
10537
  * @since 0.0.25
9213
10538
  * @contractStatus verified | 开始监听陀螺仪的入参与成功语义已与 Android、iOS 当前实现对齐
10539
+ * @containerSupport Page | supported
10540
+ * @containerSupport Widget | unsupported
9214
10541
  * @platformSupport Android | supported | 支持开始监听陀螺仪
9215
10542
  * @platformSupport iOS | supported | 支持开始监听陀螺仪
9216
10543
  * @platformSupport PC | unsupported | 暂不支持
@@ -9222,7 +10549,15 @@ export declare interface StartDeviceMotionListeningParams {
9222
10549
  * ```json
9223
10550
  * {}
9224
10551
  * ```
9225
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认设备是否支持陀螺仪传感器
10552
+ * @errorExample
10553
+ * ```json
10554
+ * {
10555
+ * "errNo": 103,
10556
+ * "errMsg": "feature not support"
10557
+ * }
10558
+ * ```
10559
+ * @errorCode common | 102 | Android,iOS
10560
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 当前设备不支持陀螺仪传感器或无法注册监听 | 在具备陀螺仪传感器的设备上调用,或提前提示用户设备不支持。
9226
10561
  *
9227
10562
  * @public
9228
10563
  */
@@ -9258,6 +10593,8 @@ export declare interface StartGyroscopeParams {
9258
10593
  * @since 0.0.32
9259
10594
  * @contractStatus conflict | iOS 原生参数模型要求 type 必传,与公开可选类型冲突
9260
10595
  * @contractMismatch blocking | default | type | iOS | type 可省略,省略时使用 gcj02 | 省略 type 时调用失败 | iOS 调用方必须显式传入 type | packages/open-api/src/location/location.ts; ai-sdk/ios/AISDK/Sources/JSBridge/IDL/System/AbsStartLocationUpdateMethodIDL.swift | 将 iOS type 调整为可选并保留 gcj02 默认值,或将公开参数改为必填
10596
+ * @containerSupport Page | supported
10597
+ * @containerSupport Widget | unsupported
9261
10598
  * @platformSupport Android | supported | 支持启动持续定位
9262
10599
  * @platformSupport iOS | supported | 支持启动持续定位
9263
10600
  * @platformSupport PC | unsupported | 暂不支持
@@ -9276,7 +10613,22 @@ export declare interface StartGyroscopeParams {
9276
10613
  * ```json
9277
10614
  * {}
9278
10615
  * ```
9279
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息检查授权、系统定位服务和是否重复启动
10616
+ * @errorExample
10617
+ * ```json
10618
+ * {
10619
+ * "errNo": 1700001,
10620
+ * "errMsg": "location permission denied"
10621
+ * }
10622
+ * ```
10623
+ * @errorCode common | 102 | Android,iOS
10624
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 当前豆包客户端未提供持续定位能力(location service 不可用) | 请在支持持续定位的豆包版本中调用
10625
+ * @errorCode errNo | 114 | operation cancelled | Android,iOS | 启动过程中被取消(用户取消授权,或授权返回前已调用 stopLocationUpdate) | 需要时重新调用 startLocationUpdate
10626
+ * @errorCode errNo | 118 | already exists | Android,iOS | 持续定位已启动,重复调用 startLocationUpdate | 先调用 stopLocationUpdate 再重新启动
10627
+ * @errorCode errNo | 1700001 | location permission denied | Android,iOS | 用户拒绝应用位置授权或系统定位权限被拒 | 调用 authorize 重新发起授权并在系统设置中开启定位权限后重试
10628
+ * @errorCode errNo | 1700002 | location network error | Android,iOS | 位置授权过程中发生网络错误 | 检查网络连接后重试
10629
+ * @errorCode errNo | 104 | invalid parameter | iOS | 位置授权 scope 非法 | 检查应用权限声明中配置的 scope 后重试
10630
+ * @platformNote Android | 用户拒绝授权返回 1700001、取消返回 114、授权网络失败返回 1700002;当前豆包客户端不支持持续定位时返回 103;其他失败统一返回 102。
10631
+ * @platformNote iOS | 用户拒绝授权返回 1700001、取消返回 114、授权网络失败返回 1700002、非法 scope 返回 104;当前豆包客户端不支持持续定位时返回 103;其他失败统一返回 102。
9280
10632
  *
9281
10633
  * @public
9282
10634
  */
@@ -9309,6 +10661,8 @@ export declare interface StartLocationUpdateParams {
9309
10661
  *
9310
10662
  * @since 0.0.25
9311
10663
  * @contractStatus verified | 双端均可初始化 Wi-Fi 模块
10664
+ * @containerSupport Page | supported
10665
+ * @containerSupport Widget | unsupported
9312
10666
  * @platformSupport Android | supported | 支持初始化 Wi-Fi 模块
9313
10667
  * @platformSupport iOS | supported | 支持初始化 Wi-Fi 模块
9314
10668
  * @platformSupport PC | unsupported | 暂不支持
@@ -9319,7 +10673,16 @@ export declare interface StartLocationUpdateParams {
9319
10673
  * ```json
9320
10674
  * {}
9321
10675
  * ```
9322
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据返回的错误信息重试
10676
+ * @errorExample
10677
+ * ```json
10678
+ * {
10679
+ * "errNo": 103,
10680
+ * "errMsg": "feature not support"
10681
+ * }
10682
+ * ```
10683
+ * @errorCode common | 102 | Android
10684
+ * @errorCode errNo | 103 | feature not support | Android | 设备无可用的 Wi-Fi 能力(缺少系统 Wi-Fi 服务) | 检查设备是否支持 Wi-Fi,不支持时不要调用
10685
+ * @platformNote iOS | 初始化恒返回成功,不返回失败错误码。
9323
10686
  *
9324
10687
  * @public
9325
10688
  */
@@ -9369,6 +10732,8 @@ export declare interface StatResult {
9369
10732
  * @returns 不包含字段的结果对象。
9370
10733
  * @since 0.0.25
9371
10734
  * @contractStatus verified | 停止监听加速度的成功语义已与 Android、iOS 当前实现对齐
10735
+ * @containerSupport Page | supported
10736
+ * @containerSupport Widget | unsupported
9372
10737
  * @platformSupport Android | supported | 支持停止监听加速度
9373
10738
  * @platformSupport iOS | supported | 支持停止监听加速度
9374
10739
  * @platformSupport PC | unsupported | 暂不支持
@@ -9399,6 +10764,8 @@ export declare const stopAccelerometer: (params?: {} | undefined) => Promise<obj
9399
10764
  * @since 0.0.25
9400
10765
  * @contractStatus verified | 停止搜索的成功语义与公开类型一致;双端权限与失败行为不同但不影响公开契约
9401
10766
  * @contractMismatch non-blocking | behavior | 失败行为 | Android,iOS | 停止搜索并返回成功 | Android 需定位与蓝牙权限、缺失时可能失败,iOS 恒返回成功 | 双端失败可能性不同,但公开成功语义一致 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/StopBeaconDiscoveryMethod.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeDeviceBeaconMethods.swift | 统一双端停止搜索的权限与成功行为
10767
+ * @containerSupport Page | supported
10768
+ * @containerSupport Widget | unsupported
9402
10769
  * @platformSupport Android | supported | 支持停止搜索 iBeacon
9403
10770
  * @platformSupport iOS | supported | 支持停止搜索 iBeacon
9404
10771
  * @platformSupport PC | unsupported | 暂不支持
@@ -9440,6 +10807,8 @@ export declare const stopBeaconDiscovery: (params?: {} | undefined) => Promise<o
9440
10807
  * @returns 不包含字段的结果对象。
9441
10808
  * @since 0.0.25
9442
10809
  * @contractStatus verified | 停止搜索蓝牙设备的入参与返回结构已与 Android、iOS 当前实现对齐
10810
+ * @containerSupport Page | supported
10811
+ * @containerSupport Widget | unsupported
9443
10812
  * @platformSupport Android | supported | 支持停止搜索蓝牙设备
9444
10813
  * @platformSupport iOS | supported | 支持停止搜索蓝牙设备
9445
10814
  * @platformSupport PC | unsupported | 暂不支持
@@ -9471,6 +10840,8 @@ export declare const stopBluetoothDevicesDiscovery: (params?: {} | undefined) =>
9471
10840
  * @returns 不包含字段的结果对象。
9472
10841
  * @since 0.0.25
9473
10842
  * @contractStatus verified | 停止监听罗盘的成功语义已与 Android、iOS 当前实现对齐
10843
+ * @containerSupport Page | supported
10844
+ * @containerSupport Widget | unsupported
9474
10845
  * @platformSupport Android | supported | 支持停止监听罗盘
9475
10846
  * @platformSupport iOS | supported | 支持停止监听罗盘
9476
10847
  * @platformSupport PC | unsupported | 暂不支持
@@ -9500,6 +10871,8 @@ export declare const stopCompass: (params?: {} | undefined) => Promise<object>;
9500
10871
  * @returns 不包含字段的结果对象。
9501
10872
  * @since 0.0.25
9502
10873
  * @contractStatus verified | 停止监听设备方向的成功语义已与 Android、iOS 当前实现对齐
10874
+ * @containerSupport Page | supported
10875
+ * @containerSupport Widget | unsupported
9503
10876
  * @platformSupport Android | supported | 支持停止监听设备方向变化
9504
10877
  * @platformSupport iOS | supported | 支持停止监听设备方向变化
9505
10878
  * @platformSupport PC | unsupported | 暂不支持
@@ -9529,6 +10902,8 @@ export declare const stopDeviceMotionListening: (params?: {} | undefined) => Pro
9529
10902
  * @returns 不包含字段的结果对象。
9530
10903
  * @since 0.0.25
9531
10904
  * @contractStatus verified | 停止监听陀螺仪的成功语义已与 Android、iOS 当前实现对齐
10905
+ * @containerSupport Page | supported
10906
+ * @containerSupport Widget | unsupported
9532
10907
  * @platformSupport Android | supported | 支持停止监听陀螺仪
9533
10908
  * @platformSupport iOS | supported | 支持停止监听陀螺仪
9534
10909
  * @platformSupport PC | unsupported | 暂不支持
@@ -9558,6 +10933,8 @@ export declare const stopGyroscope: (params?: {} | undefined) => Promise<object>
9558
10933
  * @returns 不包含字段的结果对象。
9559
10934
  * @since 0.0.32
9560
10935
  * @contractStatus verified | 停止语义与 Android、iOS 当前实现一致,未启动时调用也成功
10936
+ * @containerSupport Page | supported
10937
+ * @containerSupport Widget | unsupported
9561
10938
  * @platformSupport Android | supported | 支持停止持续定位
9562
10939
  * @platformSupport iOS | supported | 支持停止持续定位
9563
10940
  * @platformSupport PC | unsupported | 暂不支持
@@ -9569,7 +10946,16 @@ export declare const stopGyroscope: (params?: {} | undefined) => Promise<object>
9569
10946
  * ```json
9570
10947
  * {}
9571
10948
  * ```
9572
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认持续定位状态后重试
10949
+ * @errorExample
10950
+ * ```json
10951
+ * {
10952
+ * "errNo": 103,
10953
+ * "errMsg": "feature not support"
10954
+ * }
10955
+ * ```
10956
+ * @errorCode common | 102 | Android,iOS
10957
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 当前豆包客户端未提供持续定位能力(location service 不可用),无法停止 | 请在支持持续定位的豆包版本中调用
10958
+ * @platformNote All | 未启动或仍在授权阶段调用直接返回成功;仅在已启动后停止失败时返回错误码,其他失败统一返回 102。
9573
10959
  *
9574
10960
  * @public
9575
10961
  */
@@ -9589,6 +10975,8 @@ export declare function stopLocationUpdate(): Promise<LocationOperationResult>;
9589
10975
  *
9590
10976
  * @since 0.0.25
9591
10977
  * @contractStatus verified | 双端均可关闭 Wi-Fi 模块
10978
+ * @containerSupport Page | supported
10979
+ * @containerSupport Widget | unsupported
9592
10980
  * @platformSupport Android | supported | 支持关闭 Wi-Fi 模块
9593
10981
  * @platformSupport iOS | supported | 支持关闭 Wi-Fi 模块
9594
10982
  * @platformSupport PC | unsupported | 暂不支持
@@ -9599,7 +10987,7 @@ export declare function stopLocationUpdate(): Promise<LocationOperationResult>;
9599
10987
  * ```json
9600
10988
  * {}
9601
10989
  * ```
9602
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据返回的错误信息重试
10990
+ * @errorCode none | - | - | Android,iOS | 该接口双端恒返回成功,无 API 专属错误码 | 无需处理
9603
10991
  *
9604
10992
  * @public
9605
10993
  */
@@ -9754,6 +11142,18 @@ export declare interface ThemeChangeEvent {
9754
11142
  */
9755
11143
  export declare type ThemeChangeListener = (event: ThemeChangeEvent) => void;
9756
11144
 
11145
+ /**
11146
+ * Tool 返回的标准内容。
11147
+ *
11148
+ * @public
11149
+ */
11150
+ export declare interface ToolResult {
11151
+ /** Tool 返回的内容块。 */
11152
+ content?: Array<Record<string, unknown>>;
11153
+ /** Tool 返回的结构化内容。 */
11154
+ structuredContent?: unknown;
11155
+ }
11156
+
9757
11157
  /**
9758
11158
  * {@link FileSystemManager.truncate} 的参数。
9759
11159
  *
@@ -9777,6 +11177,18 @@ export declare interface TruncateParams {
9777
11177
 
9778
11178
  declare type TypeGuard<From, To extends From> = (from: From) => from is To;
9779
11179
 
11180
+ /**
11181
+ * 尚未获得权限时的精细状态。
11182
+ *
11183
+ * 取值说明:
11184
+ * - `not determined`:系统明确表示用户尚未作出选择
11185
+ * - `denied`:当前没有权限;可能是用户拒绝、关闭权限,或平台无法进一步区分拒绝原因
11186
+ * - `restricted`:系统明确表示权限受设备管理、家长控制等策略限制,用户无法直接修改
11187
+ *
11188
+ * @public
11189
+ */
11190
+ export declare type UnauthorizedDetail = 'not determined' | 'denied' | 'restricted';
11191
+
9780
11192
  /**
9781
11193
  * {@link FileSystemManager.unlink} 的参数。
9782
11194
  *
@@ -9831,6 +11243,8 @@ export declare interface UnzipParams {
9831
11243
  *
9832
11244
  * @since 0.0.26
9833
11245
  * @contractStatus verified | 公开定义与 Android、iOS 的成功、失败路径一致。
11246
+ * @containerSupport Page | supported
11247
+ * @containerSupport Widget | supported
9834
11248
  * @platformSupport Android | supported | 支持向 Agent 捐赠模型上下文。
9835
11249
  * @platformSupport iOS | supported | 支持向 Agent 捐赠模型上下文。
9836
11250
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -9839,7 +11253,23 @@ export declare interface UnzipParams {
9839
11253
  * @precondition Android | 未传 taskId 时需传 entityId;两者都不传时仅可在卡片环境调用,以便客户端补充必要信息。
9840
11254
  * @precondition iOS | 未传 taskId 时需传 entityId;两者都不传时仅可在卡片环境调用,以便客户端补充必要信息。
9841
11255
  * @usageNote All | 用于在任务或实体维度补充模型可理解的上下文,请在业务状态变化后按需调用,避免高频重复捐赠相同内容。
9842
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
11256
+ * @errorExample
11257
+ * ```json
11258
+ * {
11259
+ * "errNo": 305,
11260
+ * "errMsg": "network failure"
11261
+ * }
11262
+ * ```
11263
+ * @errorCode common | 100 | Android
11264
+ * @errorCode common | 102 | Android
11265
+ * @errorCode errNo | 103 | feature not support | Android | 当前容器类型不受支持,无法归类为页面、卡片或 Worker 来源 | 请在支持的容器(页面、卡片或 Worker)环境中调用。
11266
+ * @errorCode errNo | 112 | invalid result | Android | 捐赠上下文的远端响应无法解析 | 稍后重试;持续失败时反馈服务端响应异常。
11267
+ * @errorCode errNo | 301 | network request cancelled | iOS | 捐赠上下文的网络请求被取消 | 确认应用与网络状态后重试。
11268
+ * @errorCode errNo | 302 | connection timed out | Android,iOS | 捐赠上下文的网络连接超时 | 检查网络连接后重试。
11269
+ * @errorCode errNo | 303 | no network connection | Android,iOS | 当前无可用网络连接 | 恢复网络连接后重试。
11270
+ * @errorCode errNo | 305 | network failure | Android,iOS | 捐赠上下文时发生其他网络错误 | 检查网络连接,稍后重试。
11271
+ * @platformNote Android | 网络失败细分为连接超时 302、无网络 303、其他网络错误 305;远端响应无法解析返回 112;当前容器类型不受支持返回 103;其他失败统一返回 102,未归类的远端业务错误返回 100。
11272
+ * @platformNote iOS | 依据网络错误细分:请求取消 301、连接超时 302、无网络 303、其他 305;不支持的调用来源仅回退处理、不作为失败。
9843
11273
  *
9844
11274
  * @public
9845
11275
  */
@@ -9888,6 +11318,8 @@ export declare interface UpdateModelContextParams {
9888
11318
  *
9889
11319
  * @since 0.0.26
9890
11320
  * @contractStatus verified | 公开定义与 Android、iOS 的成功、失败路径一致。
11321
+ * @containerSupport Page | supported
11322
+ * @containerSupport Widget | supported
9891
11323
  * @platformSupport Android | supported | 支持更新 Widget 卡片实例的渲染数据。
9892
11324
  * @platformSupport iOS | supported | 支持更新 Widget 卡片实例的渲染数据。
9893
11325
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -9896,7 +11328,18 @@ export declare interface UpdateModelContextParams {
9896
11328
  * @precondition Android | 在卡片或消息环境中调用,需传入有效的 widgetInstanceId。
9897
11329
  * @precondition iOS | 在卡片或消息环境中调用,需传入有效的 widgetInstanceId。
9898
11330
  * @usageNote All | 请在卡片交互或服务端结果回写后调用;传入的 widgetData 通常为 `JSON.stringify(viewData)`。
9899
- * @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
11331
+ * @errorExample
11332
+ * ```json
11333
+ * {
11334
+ * "errNo": 104,
11335
+ * "errMsg": "invalid parameter"
11336
+ * }
11337
+ * ```
11338
+ * @errorCode common | 102 | Android,iOS
11339
+ * @errorCode errNo | 103 | feature not support | Android,iOS | 当前豆包环境未提供消息更新能力 | 请在支持卡片消息更新的豆包环境中调用。
11340
+ * @errorCode errNo | 104 | invalid parameter | Android,iOS | widgetInstanceId 或 widgetData 为空,或传入了空字符串的 widgetId | 传入非空的 widgetInstanceId、widgetData,并确保 widgetId 有效后重试。
11341
+ * @errorCode errNo | 116 | resource not found | Android,iOS | 依据 widgetInstanceId 找不到对应消息,或依据 widgetId 找不到已注册的 Widget | 确认 widgetInstanceId 与 widgetId 有效后重试。
11342
+ * @platformNote All | 参数为空返回 104;消息或 Widget 未找到返回 116;当前豆包环境未提供消息更新能力时返回 103;其他失败统一返回 102。
9900
11343
  *
9901
11344
  * @public
9902
11345
  */
@@ -9965,6 +11408,8 @@ export declare interface UpdateWidgetParams {
9965
11408
  *
9966
11409
  * @since 0.0.39
9967
11410
  * @contractStatus verified | enableProfile 当前仅允许 false,Android、iOS 均支持正常发起上传。
11411
+ * @containerSupport Page | supported
11412
+ * @containerSupport Widget | unsupported
9968
11413
  * @platformSupport Android | supported | 支持文件上传、进度监听、响应头监听和中断任务。
9969
11414
  * @platformSupport iOS | supported | 支持文件上传、进度监听、响应头监听和中断任务。
9970
11415
  * @platformSupport PC | unsupported | 当前未提供该平台实现。
@@ -9978,7 +11423,7 @@ export declare interface UpdateWidgetParams {
9978
11423
  * @errorCode errNo | 121902 | uploadFile:fail no file exist | Android,iOS | filePath 为空、文件不存在或路径不是文件 | 使用文件 API 获取当前智能服务可访问的有效文件路径
9979
11424
  * @errorCode errNo | 121905 | uploadFile:fail upload file abort | Android,iOS | 调用 UploadTask.abort 中断上传 | 按业务需要处理取消状态,无需自动重试
9980
11425
  * @errorCode errNo | 121906 | uploadFile:fail file path permission denied | Android,iOS | 当前智能服务无权访问 filePath | 改用当前智能服务目录内的文件
9981
- * @errorCode errNo | 121920 | uploadFile:fail request time out | Android,iOS | 上传超过宿主超时时间 | 检查网络或设置合理的 timeout 后重试
11426
+ * @errorCode errNo | 121920 | uploadFile:fail request time out | Android,iOS | 上传超过豆包客户端的超时时间 | 检查网络或设置合理的 timeout 后重试
9982
11427
  * @errorCode errNo | 121985 | uploadFile:fail network unavailable | Android,iOS | 当前网络不可用 | 恢复网络连接后重试
9983
11428
  * @errorCode errNo | 121991 | uploadFile:fail network error | Android,iOS | 上传过程中发生网络错误 | 检查网络和服务端状态后重试
9984
11429
  * @errorCode errNo | 121992 | uploadFile:fail enableProfile is not supported | Android,iOS | enableProfile 设置为 true | 移除 enableProfile 或设置为 false
@@ -10011,14 +11456,14 @@ export declare function uploadFile(params: UploadFileParams): UploadTask;
10011
11456
  * @public
10012
11457
  */
10013
11458
  export declare interface UploadFileParams {
10014
- /** 开发者服务器地址,需为完整的 HTTP/HTTPS URL,并通过宿主侧上传域名白名单校验。 */
11459
+ /** 开发者服务器地址,需为完整的 HTTP/HTTPS URL,并通过豆包配置的上传域名白名单校验。 */
10015
11460
  url: string;
10016
11461
  /** 要上传文件资源的本地路径。 */
10017
11462
  filePath: string;
10018
11463
  /** 文件对应的 form field name/key,服务端通过该 key 获取文件内容;multipart filename 使用 filePath 的 basename。 */
10019
11464
  name: string;
10020
11465
  /**
10021
- * HTTP 请求 Header。`referer`、`user-agent`、`content-type` 等宿主管控字段不会被业务覆盖。
11466
+ * HTTP 请求 Header。`referer`、`user-agent`、`content-type` 等由豆包客户端管理的字段不会被业务覆盖。
10022
11467
  *
10023
11468
  * @default -
10024
11469
  */
@@ -10030,7 +11475,7 @@ export declare interface UploadFileParams {
10030
11475
  */
10031
11476
  formData?: Record<string, unknown>;
10032
11477
  /**
10033
- * 超时时间,单位 ms;不传时使用宿主侧默认超时配置。
11478
+ * 超时时间,单位 ms;不传时使用豆包客户端的默认超时配置。
10034
11479
  *
10035
11480
  * @default -
10036
11481
  */
@@ -10072,7 +11517,7 @@ export declare interface UploadTask extends Promise<UploadFileResult> {
10072
11517
  /**
10073
11518
  * 监听上传进度变化。
10074
11519
  *
10075
- * 同一个任务可以注册多个回调,每次收到宿主进度事件时依次调用。
11520
+ * 同一个任务可以注册多个回调,每次收到豆包客户端的进度事件时依次调用。
10076
11521
  */
10077
11522
  onProgressUpdate: (callback: (event: UploadTaskProgressUpdateEvent) => void) => void;
10078
11523
  /**
@@ -10084,7 +11529,7 @@ export declare interface UploadTask extends Promise<UploadFileResult> {
10084
11529
  /**
10085
11530
  * 监听 HTTP Response Header 事件。
10086
11531
  *
10087
- * 同一个任务可以注册多个回调,宿主收到上传响应头时依次调用。
11532
+ * 同一个任务可以注册多个回调,豆包客户端收到上传响应头时依次调用。
10088
11533
  */
10089
11534
  onHeadersReceived: (callback: (event: UploadTaskHeadersReceivedEvent) => void) => void;
10090
11535
  /**
@@ -10172,6 +11617,8 @@ export declare type UserScreenRecordState = 'start' | 'stop';
10172
11617
  * @since 0.0.25
10173
11618
  * @contractStatus conflict | 长震动的成功语义双端不一致
10174
11619
  * @contractMismatch blocking | behavior | 长震动成功语义 | Android,iOS | 触发一次长震动并返回成功 | Android 固定震动约 400ms 且在设备不支持时可能失败,iOS 恒返回成功 | 依赖统一成功语义的调用方在双端体验不一致 | ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/AIBridgeVibrateMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeVibrateMethods.swift | 统一双端长震动时长与失败语义
11620
+ * @containerSupport Page | supported
11621
+ * @containerSupport Widget | supported
10175
11622
  * @platformSupport Android | supported | 支持长震动
10176
11623
  * @platformSupport iOS | supported | 支持长震动
10177
11624
  * @platformSupport PC | unsupported | 暂不支持
@@ -10183,7 +11630,16 @@ export declare type UserScreenRecordState = 'start' | 'stop';
10183
11630
  * ```json
10184
11631
  * {}
10185
11632
  * ```
10186
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认设备是否支持震动
11633
+ * @errorExample
11634
+ * ```json
11635
+ * {
11636
+ * "errNo": 103,
11637
+ * "errMsg": "feature not support"
11638
+ * }
11639
+ * ```
11640
+ * @errorCode errNo | 103 | feature not support | Android | Android 设备无振动器或不支持震动能力 | 提示用户当前设备不支持震动,避免依赖该能力
11641
+ * @errorCode common | 102 | Android
11642
+ * @platformNote iOS | 长震动恒返回成功,无失败错误码
10187
11643
  *
10188
11644
  * @public
10189
11645
  */
@@ -10203,6 +11659,8 @@ export declare const vibrateLong: (params?: {} | undefined) => Promise<object>;
10203
11659
  * @since 0.0.25
10204
11660
  * @contractStatus conflict | type 参数在 Android 侧的必填性与 TypeScript 可选声明不一致
10205
11661
  * @contractMismatch blocking | parameter | type | Android | 可选参数,省略时使用默认强度 | Android 底层要求必传 type,省略可能导致调用不生效 | 未显式传 type 的调用在 Android 上行为不确定 | packages/open-api/src/device/vibration/vibration.ts; ai-sdk/android/ai-sdk/src/main/java/com/bytedance/ai/bridge/method/device/AIBridgeVibrateMethods.kt; ai-sdk/ios/AISDK/Sources/JSBridge/Methods/Device/AIBridgeVibrateMethods.swift | 对齐双端 type 的可选性与默认值
11662
+ * @containerSupport Page | supported
11663
+ * @containerSupport Widget | supported
10206
11664
  * @platformSupport Android | supported | 支持短震动
10207
11665
  * @platformSupport iOS | supported | 支持短震动
10208
11666
  * @platformSupport PC | unsupported | 暂不支持
@@ -10214,7 +11672,16 @@ export declare const vibrateLong: (params?: {} | undefined) => Promise<object>;
10214
11672
  * ```json
10215
11673
  * {}
10216
11674
  * ```
10217
- * @errorCode none | - | - | Android,iOS | 当前实现未稳定返回顶层 errNo/errMsg | 根据异常信息确认设备是否支持震动
11675
+ * @errorExample
11676
+ * ```json
11677
+ * {
11678
+ * "errNo": 103,
11679
+ * "errMsg": "feature not support"
11680
+ * }
11681
+ * ```
11682
+ * @errorCode errNo | 103 | feature not support | Android,iOS | Android 设备无振动器或不支持震动能力,或 iOS 系统版本低于 13.0 | 提示用户当前设备或系统不支持震动,避免依赖该能力
11683
+ * @errorCode common | 102 | Android
11684
+ * @platformNote Android | 设备不支持震动或触发震动失败时返回 102 internal error;iOS 无对应失败错误码
10218
11685
  *
10219
11686
  * @public
10220
11687
  */
@@ -10339,6 +11806,8 @@ export declare interface WindowSafeArea {
10339
11806
  * @returns 不包含字段的结果对象。
10340
11807
  * @since 0.0.25
10341
11808
  * @contractStatus verified | 写入特征值的入参与返回结构已与 Android、iOS 当前实现对齐;value 由框架统一编码为 Base64 传给原生
11809
+ * @containerSupport Page | supported
11810
+ * @containerSupport Widget | unsupported
10342
11811
  * @platformSupport Android | supported | 支持写入 BLE 特征值
10343
11812
  * @platformSupport iOS | supported | 支持写入 BLE 特征值
10344
11813
  * @platformSupport PC | unsupported | 暂不支持