@doubao-dev/framework 0.0.41 → 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 +1211 -149
- package/dist/components.d.ts +438 -97
- package/dist/config.d.ts +64 -1
- package/dist/index.d.ts +125 -3
- package/package.json +1 -1
- package/types.d.ts +3 -0
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
|
-
/**
|
|
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,19 +263,31 @@ 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
|
-
* @
|
|
255
|
-
* @
|
|
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 |
|
|
259
|
-
* @
|
|
260
|
-
* @
|
|
261
|
-
* @
|
|
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 不向应用公开每个读取类型是否被用户拒绝。
|
|
262
291
|
* @errorExample
|
|
263
292
|
* ```json
|
|
264
293
|
* {
|
|
@@ -268,6 +297,7 @@ export declare type AppTheme = 'light' | 'dark';
|
|
|
268
297
|
* ```
|
|
269
298
|
* @errorCode common | 102 | Android,iOS
|
|
270
299
|
* @errorCode errNo | 104 | invalid parameter | Android,iOS | 传入的 scope 为空或不受支持(如 scope.payment) | 检查并传入受支持的 scope 后重试。
|
|
300
|
+
* @errorCode errNo | 104 | invalid parameter | iOS | scope.healthData 未传 options.types、列表为空或包含不支持类型 | 传入非空且受支持的健康数据类型列表。
|
|
271
301
|
* @errorCode errNo | 106 | system permission denied | Android,iOS | 对应能力的系统权限被拒绝 | 引导用户在系统设置中开启对应权限后重试。
|
|
272
302
|
* @errorCode errNo | 107 | user permission denied | Android,iOS | 用户拒绝了本次应用授权 | 说明能力用途后再次调用 `authorize` 重新发起授权。
|
|
273
303
|
* @errorCode errNo | 114 | operation cancelled | Android,iOS | 用户取消了授权弹窗 | 用户需要时可再次调用 `authorize` 重新发起授权。
|
|
@@ -284,12 +314,13 @@ export declare const authorize: (params: AuthorizeRequest) => Promise<object>;
|
|
|
284
314
|
|
|
285
315
|
/** @public */
|
|
286
316
|
export declare interface AuthorizeRequest {
|
|
317
|
+
/** 授权范围。 */
|
|
318
|
+
scope: Scope;
|
|
287
319
|
/**
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
* @constraint 豆包 Android、iOS 当前不支持 scope.payment,传入后授权会失败
|
|
320
|
+
* 权限扩展参数;仅 scope.healthData 生效,用于传入 HealthKit 读取类型,其他 scope 会忽略该字段。
|
|
321
|
+
* @default -
|
|
291
322
|
*/
|
|
292
|
-
|
|
323
|
+
options?: HealthDataAuthorizeOptions;
|
|
293
324
|
}
|
|
294
325
|
|
|
295
326
|
/** @public */
|
|
@@ -441,6 +472,16 @@ export declare interface BackgroundAudioState {
|
|
|
441
472
|
playbackRate?: number;
|
|
442
473
|
}
|
|
443
474
|
|
|
475
|
+
/**
|
|
476
|
+
* 只有完整授权和未授权状态的权限所使用的通用精细状态。
|
|
477
|
+
*
|
|
478
|
+
* 继承 {@link UnauthorizedDetail} 的全部取值,并增加:
|
|
479
|
+
* - `full`:已获得该权限的完整访问能力。
|
|
480
|
+
*
|
|
481
|
+
* @public
|
|
482
|
+
*/
|
|
483
|
+
export declare type BasicAuthorizationDetail = UnauthorizedDetail | 'full';
|
|
484
|
+
|
|
444
485
|
/**
|
|
445
486
|
* 电池信息变化事件。
|
|
446
487
|
*
|
|
@@ -529,6 +570,16 @@ export declare type BluetoothAdapterStateChangeEvent = GetBluetoothAdapterStateR
|
|
|
529
570
|
/** @public */
|
|
530
571
|
export declare type BluetoothAdapterStateChangeListener = (event: BluetoothAdapterStateChangeEvent) => void;
|
|
531
572
|
|
|
573
|
+
/**
|
|
574
|
+
* 蓝牙精细授权状态。
|
|
575
|
+
*
|
|
576
|
+
* 继承 {@link BasicAuthorizationDetail} 的全部取值,并增加:
|
|
577
|
+
* - `partial`:只获得部分已声明的蓝牙子权限;仅 Android 支持。
|
|
578
|
+
*
|
|
579
|
+
* @public
|
|
580
|
+
*/
|
|
581
|
+
export declare type BluetoothAuthorizationDetail = BasicAuthorizationDetail | 'partial';
|
|
582
|
+
|
|
532
583
|
/**
|
|
533
584
|
* 蓝牙广播二进制字段。
|
|
534
585
|
*
|
|
@@ -739,6 +790,156 @@ export declare type BottomSheetCancelSource = 'mask' | 'gesture' | 'hostUnavaila
|
|
|
739
790
|
*/
|
|
740
791
|
export declare type CalendarRepeatInterval = 'day' | 'week' | 'month' | 'year';
|
|
741
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
|
+
|
|
742
943
|
/** @public */
|
|
743
944
|
export declare interface CanIUseParams {
|
|
744
945
|
/** 需要检测的能力标识,例如 API 名称 */
|
|
@@ -751,6 +952,47 @@ export declare interface CanIUseResult {
|
|
|
751
952
|
result: boolean;
|
|
752
953
|
}
|
|
753
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
|
+
|
|
754
996
|
/**
|
|
755
997
|
* 检测无障碍能力是否开启。
|
|
756
998
|
*
|
|
@@ -766,6 +1008,7 @@ export declare interface CanIUseResult {
|
|
|
766
1008
|
* @since 0.0.25
|
|
767
1009
|
* @contractStatus verified | open 字段的类型与必返性已与 Android、iOS 当前实现对齐;双端检测的无障碍能力口径不同但公开类型已准确表达
|
|
768
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
|
|
769
1012
|
* @platformSupport Android | supported | 支持检测无障碍能力
|
|
770
1013
|
* @platformSupport iOS | supported | 支持检测无障碍能力
|
|
771
1014
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -822,6 +1065,8 @@ export declare interface CheckIsOpenAccessibilityResult {
|
|
|
822
1065
|
* @contractStatus conflict | sizeType 不生效,sourceType 仅支持“只传 camera”与相册两种实际分支
|
|
823
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 | 补齐双端原图与压缩图选择逻辑,或移除公开字段
|
|
824
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
|
|
825
1070
|
* @platformSupport Android | supported | 支持从相册选择图片;只传 camera 时支持拍照
|
|
826
1071
|
* @platformSupport iOS | supported | 支持从相册选择图片;只传 camera 时支持拍照
|
|
827
1072
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -1059,6 +1304,8 @@ export declare type ChooseMessageFileType = 'all' | 'video' | 'image' | 'file';
|
|
|
1059
1304
|
*
|
|
1060
1305
|
* @since 0.0.17
|
|
1061
1306
|
* @contractStatus verified | 清空语义及 Android、iOS 错误字段已核对一致。
|
|
1307
|
+
* @containerSupport Page | supported
|
|
1308
|
+
* @containerSupport Widget | supported
|
|
1062
1309
|
* @platformSupport Android | supported | 支持清空当前智能服务的全部本地缓存。
|
|
1063
1310
|
* @platformSupport iOS | supported | 支持清空当前智能服务的全部本地缓存。
|
|
1064
1311
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -1085,6 +1332,8 @@ export declare const clearStorage: (params?: object | undefined) => Promise<obje
|
|
|
1085
1332
|
*
|
|
1086
1333
|
* @since 0.0.19
|
|
1087
1334
|
* @contractStatus verified | 清空语义及 Android、iOS 错误字段已核对一致。
|
|
1335
|
+
* @containerSupport Page | supported
|
|
1336
|
+
* @containerSupport Widget | supported
|
|
1088
1337
|
* @platformSupport Android | supported | 支持同步清空当前智能服务的全部本地缓存。
|
|
1089
1338
|
* @platformSupport iOS | supported | 支持同步清空当前智能服务的全部本地缓存。
|
|
1090
1339
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -1155,6 +1404,8 @@ export { close_2 as close }
|
|
|
1155
1404
|
* @returns 不包含字段的结果对象。
|
|
1156
1405
|
* @since 0.0.25
|
|
1157
1406
|
* @contractStatus verified | 关闭 BLE 连接的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
1407
|
+
* @containerSupport Page | supported
|
|
1408
|
+
* @containerSupport Widget | unsupported
|
|
1158
1409
|
* @platformSupport Android | supported | 支持关闭 BLE 连接
|
|
1159
1410
|
* @platformSupport iOS | supported | 支持关闭 BLE 连接
|
|
1160
1411
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -1200,6 +1451,8 @@ export declare interface CloseBLEConnectionParams {
|
|
|
1200
1451
|
* @returns 不包含字段的结果对象。
|
|
1201
1452
|
* @since 0.0.25
|
|
1202
1453
|
* @contractStatus verified | 关闭蓝牙适配器的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
1454
|
+
* @containerSupport Page | supported
|
|
1455
|
+
* @containerSupport Widget | unsupported
|
|
1203
1456
|
* @platformSupport Android | supported | 支持关闭蓝牙适配器
|
|
1204
1457
|
* @platformSupport iOS | supported | 支持关闭蓝牙适配器
|
|
1205
1458
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -1261,6 +1514,8 @@ export declare type CompassChangeListener = (event: CompassChangeEvent) => void;
|
|
|
1261
1514
|
* ```
|
|
1262
1515
|
* @since 0.0.26
|
|
1263
1516
|
* @contractStatus verified | Android、iOS 均按相同默认质量和尺寸组合规则输出 JPEG 临时文件
|
|
1517
|
+
* @containerSupport Page | supported
|
|
1518
|
+
* @containerSupport Widget | unsupported
|
|
1264
1519
|
* @platformSupport Android | supported | 支持压缩豆包智能服务本地图片
|
|
1265
1520
|
* @platformSupport iOS | supported | 支持压缩豆包智能服务本地图片
|
|
1266
1521
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -1389,6 +1644,8 @@ export declare interface ConnectedBluetoothDevice {
|
|
|
1389
1644
|
* @since 0.0.30
|
|
1390
1645
|
* @contractStatus verified | ws 和 wss 均可创建连接,握手结果通过 SocketTask 事件回调通知;SocketTaskOpenEvent.header 恒为空对象已在公开类型说明中表达。
|
|
1391
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
|
|
1392
1649
|
* @platformSupport Android | supported | 支持 ws 和 wss 协议的 WebSocket 连接。
|
|
1393
1650
|
* @platformSupport iOS | supported | 支持 ws 和 wss 协议的 WebSocket 连接。
|
|
1394
1651
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -1428,13 +1685,13 @@ export declare function connectSocket(params: ConnectSocketParams): SocketTask;
|
|
|
1428
1685
|
/**
|
|
1429
1686
|
* 创建 WebSocket 连接的参数。
|
|
1430
1687
|
*
|
|
1431
|
-
* `connectSocket`
|
|
1688
|
+
* `connectSocket` 会把这些参数交给豆包客户端创建连接。连接创建请求发出后,
|
|
1432
1689
|
* 调用方会立即拿到一个 {@link SocketTask},后续连接成功、失败、收到消息和关闭状态
|
|
1433
1690
|
* 都通过 `SocketTask` 上注册的事件回调通知。
|
|
1434
1691
|
*
|
|
1435
1692
|
* @remarks
|
|
1436
|
-
* - `url` 应填写完整的 WebSocket 地址。线上环境通常要求使用 `wss://`
|
|
1437
|
-
* - `header` 用于补充握手请求头,`referer`
|
|
1693
|
+
* - `url` 应填写完整的 WebSocket 地址。线上环境通常要求使用 `wss://` 协议,并由豆包客户端按当前智能服务配置校验合法域名和证书。
|
|
1694
|
+
* - `header` 用于补充握手请求头,`referer` 等由豆包客户端管理的字段不会被业务代码覆盖。
|
|
1438
1695
|
* - `protocols` 非空时,服务端需要在握手响应中选择并返回匹配的子协议,否则连接可能失败。
|
|
1439
1696
|
* - 同一个页面多次调用会创建多个独立连接,已创建的旧连接不会因为新连接自动关闭。
|
|
1440
1697
|
*
|
|
@@ -1453,7 +1710,7 @@ export declare interface ConnectSocketParams {
|
|
|
1453
1710
|
* WebSocket 握手阶段携带的 HTTP Header。
|
|
1454
1711
|
*
|
|
1455
1712
|
* 适合放置业务自定义 Header,例如鉴权 token、trace id、客户端能力标识等。
|
|
1456
|
-
* `referer`
|
|
1713
|
+
* `referer` 由豆包客户端统一生成和管理,不应依赖该字段被业务传入值覆盖。
|
|
1457
1714
|
*
|
|
1458
1715
|
* @default -
|
|
1459
1716
|
*/
|
|
@@ -1463,7 +1720,7 @@ export declare interface ConnectSocketParams {
|
|
|
1463
1720
|
*
|
|
1464
1721
|
* 会作为握手请求中的 `Sec-WebSocket-Protocol` 候选值传给服务端。
|
|
1465
1722
|
* 如果传入非空数组,服务端需要选择其中一个协议并在握手响应中返回;
|
|
1466
|
-
*
|
|
1723
|
+
* 服务端不支持或不返回匹配协议时,豆包客户端可能判定连接创建失败。
|
|
1467
1724
|
*
|
|
1468
1725
|
* @default -
|
|
1469
1726
|
*/
|
|
@@ -1488,6 +1745,8 @@ export declare interface ConnectSocketParams {
|
|
|
1488
1745
|
* @since 0.0.25
|
|
1489
1746
|
* @contractStatus conflict | 双端均可连接 Wi-Fi,但 bssid 参数仅 Android 生效
|
|
1490
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
|
|
1491
1750
|
* @platformSupport Android | supported | 支持连接 Wi-Fi,可按 bssid 指定目标
|
|
1492
1751
|
* @platformSupport iOS | supported | 支持连接 Wi-Fi,忽略 bssid 参数
|
|
1493
1752
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -1626,6 +1885,8 @@ export declare interface CopyFileParams {
|
|
|
1626
1885
|
* @returns 不包含字段的结果对象。
|
|
1627
1886
|
* @since 0.0.25
|
|
1628
1887
|
* @contractStatus verified | 创建 BLE 连接的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
1888
|
+
* @containerSupport Page | supported
|
|
1889
|
+
* @containerSupport Widget | unsupported
|
|
1629
1890
|
* @platformSupport Android | supported | 支持创建 BLE 连接
|
|
1630
1891
|
* @platformSupport iOS | supported | 支持创建 BLE 连接
|
|
1631
1892
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -1665,28 +1926,57 @@ export declare interface CreateBLEConnectionParams {
|
|
|
1665
1926
|
}
|
|
1666
1927
|
|
|
1667
1928
|
/**
|
|
1668
|
-
*
|
|
1929
|
+
* 创建一组用于发送和监听自定义事件的函数。
|
|
1669
1930
|
*
|
|
1670
|
-
* @
|
|
1671
|
-
* @
|
|
1672
|
-
* @
|
|
1931
|
+
* @containerSupport Page | supported
|
|
1932
|
+
* @containerSupport Widget | supported
|
|
1933
|
+
* @public
|
|
1934
|
+
*/
|
|
1935
|
+
export declare const createCustomEvent: typeof createCustomEvent_2;
|
|
1936
|
+
|
|
1937
|
+
/**
|
|
1938
|
+
* 创建一组用于发送和监听自定义事件的函数。
|
|
1939
|
+
*
|
|
1940
|
+
* 发送函数会向当前智能服务的其他 Runtime 广播事件;监听注册函数可注册多个处理函数,
|
|
1941
|
+
* 并返回对应的注销函数。发送端和接收端应复用同一份事件定义,确保事件名称和参数类型一致。
|
|
1942
|
+
*
|
|
1943
|
+
* @summary 创建自定义事件。
|
|
1944
|
+
* @param name 事件名称。建议添加业务命名空间,避免与其他事件重名。
|
|
1945
|
+
* @param options 自定义事件配置。省略时不校验接收到的事件参数。
|
|
1946
|
+
* @returns 返回一个元组,第一项用于发送事件,第二项用于注册事件处理函数。
|
|
1673
1947
|
* @category Custom API
|
|
1674
1948
|
* @example
|
|
1949
|
+
* ```typescript
|
|
1950
|
+
* import { createCustomEvent } from '@doubao-dev/framework/api';
|
|
1951
|
+
*
|
|
1675
1952
|
* interface TestEventParams {
|
|
1676
1953
|
* input: string;
|
|
1677
1954
|
* }
|
|
1678
1955
|
*
|
|
1679
|
-
* const [emitEvent, onReceiveEvent] =
|
|
1956
|
+
* const [emitEvent, onReceiveEvent] =
|
|
1957
|
+
* createCustomEvent<TestEventParams>('example.testEvent');
|
|
1680
1958
|
*
|
|
1681
|
-
*
|
|
1682
|
-
*
|
|
1959
|
+
* const unregister = onReceiveEvent((params) => {
|
|
1960
|
+
* console.log(params.input);
|
|
1961
|
+
* });
|
|
1683
1962
|
*
|
|
1684
|
-
*
|
|
1685
|
-
*
|
|
1686
|
-
*
|
|
1687
|
-
*
|
|
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
|
|
1688
1978
|
*/
|
|
1689
|
-
|
|
1979
|
+
declare function createCustomEvent_2<Params extends object>(name: string, options?: CustomEventOptions_2<Params>): [CustomEventCaller_2<Params>, CustomEventHandlerRegistry_2<Params>];
|
|
1690
1980
|
|
|
1691
1981
|
/**
|
|
1692
1982
|
* 创建一个内部音频上下文。
|
|
@@ -1707,6 +1997,8 @@ export declare function createCustomEvent<Params extends object>(name: string, o
|
|
|
1707
1997
|
* ```
|
|
1708
1998
|
* @since 0.0.37
|
|
1709
1999
|
* @contractStatus verified | Android、iOS 均支持独立实例、属性控制、基础播控和事件监听
|
|
2000
|
+
* @containerSupport Page | supported
|
|
2001
|
+
* @containerSupport Widget | unsupported
|
|
1710
2002
|
* @platformSupport Android | supported | 支持多实例内部音频播放
|
|
1711
2003
|
* @platformSupport iOS | supported | 支持多实例内部音频播放
|
|
1712
2004
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -1781,6 +2073,8 @@ export declare function createInnerAudioContext(): InnerAudioContext;
|
|
|
1781
2073
|
* @since 0.0.28
|
|
1782
2074
|
* @contractStatus verified | 成功返回结构与 Android、iOS 一致;失败通过 Promise reject,业务错误在错误对象的 data 字段。公开联合类型的失败分支不会作为 resolve 值出现,仅作后续对齐项。
|
|
1783
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
|
|
1784
2078
|
* @platformSupport Android | supported | 支持创建签约订单并返回 authOrderId。
|
|
1785
2079
|
* @platformSupport iOS | supported | 支持创建签约订单并返回 authOrderId。
|
|
1786
2080
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -1876,6 +2170,8 @@ export declare interface CreateSignOrderSuccessResult {
|
|
|
1876
2170
|
* @since 0.0.31
|
|
1877
2171
|
* @contractStatus conflict | 公开定义声明 taskType 支持 local 与 remote,豆包双端仅支持 remote。
|
|
1878
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
|
|
1879
2175
|
* @platformSupport Android | supported | 支持创建 remote 任务并返回 taskId、token。
|
|
1880
2176
|
* @platformSupport iOS | supported | 支持创建 remote 任务并返回 taskId、token。
|
|
1881
2177
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -1938,27 +2234,50 @@ export declare interface CreateTaskResult {
|
|
|
1938
2234
|
expiresIn?: number;
|
|
1939
2235
|
}
|
|
1940
2236
|
|
|
2237
|
+
/** @public */
|
|
2238
|
+
export declare type CustomEventCaller<Params extends object = object> = CustomEventCaller_2<Params>;
|
|
2239
|
+
|
|
1941
2240
|
/**
|
|
1942
|
-
*
|
|
2241
|
+
* 自定义事件发送函数。
|
|
1943
2242
|
*
|
|
1944
|
-
*
|
|
2243
|
+
* 调用后会向当前智能服务的其他 Runtime 广播事件,不返回处理结果。
|
|
2244
|
+
*
|
|
2245
|
+
* @public
|
|
1945
2246
|
*/
|
|
1946
|
-
|
|
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>;
|
|
1947
2251
|
|
|
1948
2252
|
/**
|
|
1949
|
-
*
|
|
2253
|
+
* 自定义事件监听注册函数。
|
|
2254
|
+
*
|
|
2255
|
+
* 可以为同一事件注册多个处理函数。调用返回的函数可注销当前处理函数。
|
|
1950
2256
|
*
|
|
1951
|
-
*
|
|
2257
|
+
* @public
|
|
1952
2258
|
*/
|
|
1953
|
-
|
|
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
|
+
}
|
|
1954
2270
|
|
|
1955
2271
|
/**
|
|
1956
|
-
*
|
|
2272
|
+
* 创建自定义事件的配置。
|
|
2273
|
+
*
|
|
2274
|
+
* @public
|
|
1957
2275
|
*/
|
|
1958
|
-
|
|
2276
|
+
declare interface CustomEventOptions_2<Params extends object> {
|
|
1959
2277
|
/**
|
|
1960
|
-
*
|
|
1961
|
-
*
|
|
2278
|
+
* 接收端的参数类型守卫。返回 `false` 时会忽略当前事件,不调用已注册的处理函数。
|
|
2279
|
+
*
|
|
2280
|
+
* @default -
|
|
1962
2281
|
*/
|
|
1963
2282
|
paramsTypeGuard?: TypeGuard<object, Params>;
|
|
1964
2283
|
}
|
|
@@ -2010,6 +2329,8 @@ export declare type DeviceOrientation = 'portrait' | 'landscape';
|
|
|
2010
2329
|
* @since 0.0.37
|
|
2011
2330
|
* @contractStatus verified | 禁止录屏的成功语义已与 Android、iOS 当前实现对齐;双端防护粒度不同但公开类型已准确表达
|
|
2012
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
|
|
2013
2334
|
* @platformSupport Android | supported | 支持禁止用户录屏
|
|
2014
2335
|
* @platformSupport iOS | supported | 支持禁止用户录屏
|
|
2015
2336
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -2071,9 +2392,9 @@ export declare const disableUserScreenRecord: (params?: {} | undefined) => Promi
|
|
|
2071
2392
|
* "errMsg": "resource not found"
|
|
2072
2393
|
* }
|
|
2073
2394
|
* ```
|
|
2074
|
-
* @errorCode errNo | 103 | feature not support | Android,iOS |
|
|
2395
|
+
* @errorCode errNo | 103 | feature not support | Android,iOS | 当前豆包环境未提供消息下发能力 | 请在支持消息下发的豆包环境中调用。
|
|
2075
2396
|
* @errorCode errNo | 116 | resource not found | Android,iOS | 依据 widgetInstanceId 找不到对应会话 | 确认 widgetInstanceId 有效且处于会话环境后重试。
|
|
2076
|
-
* @platformNote All | 找不到会话返回 116
|
|
2397
|
+
* @platformNote All | 找不到会话返回 116;当前豆包环境未提供消息下发能力时返回 103。
|
|
2077
2398
|
*
|
|
2078
2399
|
* @internal
|
|
2079
2400
|
*/
|
|
@@ -2184,13 +2505,15 @@ export declare interface DoubaoAppAccountInfo {
|
|
|
2184
2505
|
*
|
|
2185
2506
|
* @since 0.0.40
|
|
2186
2507
|
* @contractStatus verified | Android、iOS 均支持 HTTPS GET 下载、域名校验、临时或用户目录写入、超时、取消及进度和响应头监听。
|
|
2508
|
+
* @containerSupport Page | supported
|
|
2509
|
+
* @containerSupport Widget | unsupported
|
|
2187
2510
|
* @platformSupport Android | supported | 支持 HTTPS GET 下载、域名白名单校验、临时或用户目录写入、超时、取消及任务事件监听。
|
|
2188
2511
|
* @platformSupport iOS | supported | 支持 HTTPS GET 下载、域名白名单校验、临时或用户目录写入、超时、取消及任务事件监听。
|
|
2189
2512
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
2190
2513
|
* @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
|
|
2191
2514
|
* @permission none | - | none | Android,iOS | 无需额外权限
|
|
2192
|
-
* @precondition All |
|
|
2193
|
-
* @usageNote All | 未指定 filePath 时文件写入临时目录,并通过 Promise resolve 结果的 tempFilePath
|
|
2515
|
+
* @precondition All | 下载地址需通过豆包配置的下载域名白名单校验,单个文件不得超过 200 MB,单个智能服务同时最多执行 10 个下载任务;指定 filePath 时仅支持临时目录或用户目录。
|
|
2516
|
+
* @usageNote All | 未指定 filePath 时文件写入临时目录,并通过 Promise resolve 结果的 tempFilePath 返回;临时文件的生命周期由豆包客户端管理。
|
|
2194
2517
|
* @usageNote All | 不跟随 HTTP 重定向,3xx 响应使 Promise reject;4xx、5xx 响应在文件写入成功后仍使 Promise resolve。
|
|
2195
2518
|
* @resultExample
|
|
2196
2519
|
* ```json
|
|
@@ -2214,10 +2537,10 @@ export declare function downloadFile(params: DownloadFileParams): DownloadTask;
|
|
|
2214
2537
|
* @public
|
|
2215
2538
|
*/
|
|
2216
2539
|
export declare interface DownloadFileParams {
|
|
2217
|
-
/** 下载资源地址,需为完整 HTTPS URL
|
|
2540
|
+
/** 下载资源地址,需为完整 HTTPS URL,并通过豆包配置的下载域名白名单校验。 */
|
|
2218
2541
|
url: string;
|
|
2219
2542
|
/**
|
|
2220
|
-
* 请求 Header。`referer` 和 `user-agent`
|
|
2543
|
+
* 请求 Header。`referer` 和 `user-agent` 由豆包客户端管理,业务传入值不会透传。
|
|
2221
2544
|
*
|
|
2222
2545
|
* @default -
|
|
2223
2546
|
*/
|
|
@@ -2303,6 +2626,61 @@ export declare interface DownloadTaskHeadersReceivedEvent {
|
|
|
2303
2626
|
header: Record<string, string>;
|
|
2304
2627
|
}
|
|
2305
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
|
+
|
|
2306
2684
|
/**
|
|
2307
2685
|
* 允许用户录屏。
|
|
2308
2686
|
*
|
|
@@ -2317,6 +2695,8 @@ export declare interface DownloadTaskHeadersReceivedEvent {
|
|
|
2317
2695
|
* @since 0.0.37
|
|
2318
2696
|
* @contractStatus verified | 允许录屏的成功语义已与 Android、iOS 当前实现对齐;双端恢复机制不同但公开类型已准确表达
|
|
2319
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
|
|
2320
2700
|
* @platformSupport Android | supported | 支持允许用户录屏
|
|
2321
2701
|
* @platformSupport iOS | supported | 支持允许用户录屏
|
|
2322
2702
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -2347,6 +2727,8 @@ export declare const enableUserScreenRecord: (params?: {} | undefined) => Promis
|
|
|
2347
2727
|
*
|
|
2348
2728
|
* @since 0.0.20
|
|
2349
2729
|
* @contractStatus verified | 退出语义及 Android、iOS 失败字段已核对一致。
|
|
2730
|
+
* @containerSupport Page | supported
|
|
2731
|
+
* @containerSupport Widget | unsupported
|
|
2350
2732
|
* @platformSupport Android | supported | 支持退出当前智能服务的全部页面。
|
|
2351
2733
|
* @platformSupport iOS | supported | 支持退出当前智能服务的全部页面。
|
|
2352
2734
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -2385,6 +2767,8 @@ export declare const exitApp: () => Promise<object>;
|
|
|
2385
2767
|
*
|
|
2386
2768
|
* @since 0.0.27
|
|
2387
2769
|
* @contractStatus verified | 通过 updateWidget 实现,公开定义与 Android、iOS 的成功、失败路径一致。
|
|
2770
|
+
* @containerSupport Page | supported
|
|
2771
|
+
* @containerSupport Widget | supported
|
|
2388
2772
|
* @platformSupport Android | supported | 支持将过期卡片更新为固定卡片。
|
|
2389
2773
|
* @platformSupport iOS | supported | 支持将过期卡片更新为固定卡片。
|
|
2390
2774
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -2529,6 +2913,8 @@ export declare interface FileSystemManager {
|
|
|
2529
2913
|
* @since 0.0.18
|
|
2530
2914
|
* @contractStatus conflict | envVersion 公开声明了 trial,但 Android、iOS 当前只返回 develop 或 release。
|
|
2531
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
|
|
2532
2918
|
* @platformSupport Android | supported | 支持获取当前智能服务账号信息。
|
|
2533
2919
|
* @platformSupport iOS | supported | 支持获取当前智能服务账号信息。
|
|
2534
2920
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -2578,6 +2964,8 @@ export declare interface GetAccountInfoResult {
|
|
|
2578
2964
|
* @since 0.0.18
|
|
2579
2965
|
* @contractStatus conflict | envVersion 公开声明了 trial,但 Android、iOS 当前只返回 develop 或 release。
|
|
2580
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
|
|
2581
2969
|
* @platformSupport Android | supported | 支持同步获取当前智能服务账号信息。
|
|
2582
2970
|
* @platformSupport iOS | supported | 支持同步获取当前智能服务账号信息。
|
|
2583
2971
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -2601,31 +2989,39 @@ export declare interface GetAccountInfoResult {
|
|
|
2601
2989
|
export declare function getAccountInfoSync(params?: {}): GetAccountInfoResult;
|
|
2602
2990
|
|
|
2603
2991
|
/**
|
|
2604
|
-
*
|
|
2992
|
+
* 获取豆包客户端的系统授权设置。
|
|
2605
2993
|
*
|
|
2606
|
-
*
|
|
2607
|
-
* `authorized`、`denied` 或 `not determined
|
|
2994
|
+
* 调用只读取当前系统授权状态,不会申请权限或触发系统授权弹窗。原有状态字段固定返回
|
|
2995
|
+
* `authorized`、`denied` 或 `not determined`,精细授权字段用于区分部分、只读、只写、前后台等能力。
|
|
2608
2996
|
*
|
|
2609
|
-
* @returns
|
|
2997
|
+
* @returns 返回豆包客户端的相册、蓝牙、摄像头、定位、麦克风、通知、日历和健康数据系统权限状态。
|
|
2610
2998
|
* @example
|
|
2611
2999
|
* ```typescript
|
|
2612
3000
|
* import { getAppAuthorizeSetting } from '@doubao-dev/framework/api';
|
|
2613
3001
|
*
|
|
2614
3002
|
* const result = getAppAuthorizeSetting();
|
|
2615
|
-
*
|
|
2616
|
-
*
|
|
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);
|
|
2617
3010
|
* ```
|
|
2618
3011
|
*
|
|
2619
3012
|
* @since 0.0.40
|
|
2620
|
-
* @contractStatus verified | Android 与 iOS
|
|
2621
|
-
* @
|
|
2622
|
-
* @
|
|
3013
|
+
* @contractStatus verified | Android 与 iOS 均同步返回原有授权状态及可映射的精细授权字段;精细字段无法可靠映射或平台不适用时可为空,调用不会触发权限申请。
|
|
3014
|
+
* @containerSupport Page | supported
|
|
3015
|
+
* @containerSupport Widget | supported
|
|
3016
|
+
* @platformSupport Android | supported | 支持同步读取豆包客户端的系统权限状态。
|
|
3017
|
+
* @platformSupport iOS | supported | 支持同步读取豆包客户端的系统权限状态。
|
|
2623
3018
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
2624
3019
|
* @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
|
|
2625
3020
|
* @permission none | - | none | Android,iOS | 无需额外权限
|
|
2626
3021
|
* @precondition All | 无额外前置条件
|
|
2627
|
-
* @usageNote All |
|
|
3022
|
+
* @usageNote All | 本接口查询豆包客户端的系统权限,不等同于查询当前智能服务的 scope 授权。
|
|
2628
3023
|
* @usageNote iOS | SDK 首次完成通知设置异步预热前,或应用重新激活后的刷新尚未完成时,四个通知字段可能仍为旧值或 not determined。
|
|
3024
|
+
* @usageNote iOS | healthDataAuthorizationDetail 使用异步缓存;首次预热或应用重新激活刷新完成前可能返回 UNKNOWN。Apple 不公开精确读取授权,DENIED/GRANTED 为轻量查询推断。
|
|
2629
3025
|
* @resultExample
|
|
2630
3026
|
* ```json
|
|
2631
3027
|
* {
|
|
@@ -2639,14 +3035,30 @@ export declare function getAccountInfoSync(params?: {}): GetAccountInfoResult;
|
|
|
2639
3035
|
* "notificationAlertAuthorized": "authorized",
|
|
2640
3036
|
* "notificationBadgeAuthorized": "denied",
|
|
2641
3037
|
* "notificationSoundAuthorized": "authorized",
|
|
2642
|
-
* "phoneCalendarAuthorized": "
|
|
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
|
+
* }
|
|
2643
3052
|
* }
|
|
2644
3053
|
* ```
|
|
2645
3054
|
* @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
|
|
2646
3055
|
* @platformNote Android | albumAuthorized 和通知分项固定返回 not determined,locationReducedAccuracy 固定返回 false 且不表示实际定位精度
|
|
2647
3056
|
* @platformNote Android | bluetoothAuthorized、cameraAuthorized、locationAuthorized、microphoneAuthorized、notificationAuthorized 和 phoneCalendarAuthorized 不区分尚未申请和已经拒绝,两种情况均返回 denied
|
|
2648
3057
|
* @platformNote Android | locationAuthorized 在粗略或精确定位任一权限已授权时返回 authorized;phoneCalendarAuthorized 仅在读、写日历权限均授权时返回 authorized
|
|
3058
|
+
* @platformNote Android | 精细字段区分 Android 14 部分相册、日历读写、定位前后台和精度,以及蓝牙部分子权限
|
|
2649
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 提供的精确读取授权结果
|
|
2650
3062
|
*
|
|
2651
3063
|
* @public
|
|
2652
3064
|
*/
|
|
@@ -2676,12 +3088,63 @@ export declare interface GetAppAuthorizeSettingResult {
|
|
|
2676
3088
|
notificationSoundAuthorized: AppAuthorizeStatus;
|
|
2677
3089
|
/** 系统日历授权状态 */
|
|
2678
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;
|
|
2679
3142
|
}
|
|
2680
3143
|
|
|
2681
3144
|
/**
|
|
2682
3145
|
* 获取应用基础信息。
|
|
2683
3146
|
*
|
|
2684
|
-
* @returns 返回 SDK
|
|
3147
|
+
* @returns 返回 SDK 版本、调试开关、豆包客户端信息、语言和主题等字段,见 {@link GetAppBaseInfoResult}。
|
|
2685
3148
|
* @example
|
|
2686
3149
|
* ```typescript
|
|
2687
3150
|
* import { getAppBaseInfo } from '@doubao-dev/framework/api';
|
|
@@ -2695,6 +3158,8 @@ export declare interface GetAppAuthorizeSettingResult {
|
|
|
2695
3158
|
* @since 0.0.18
|
|
2696
3159
|
* @contractStatus conflict | Android 已实现异步应用基础信息接口,iOS 当前未注册 doubao.getAppBaseInfo,iOS 上调用会失败。
|
|
2697
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
|
|
2698
3163
|
* @platformSupport Android | supported | 支持异步获取应用基础信息。
|
|
2699
3164
|
* @platformSupport iOS | unsupported | 未注册异步应用基础信息接口,请改用 getAppBaseInfoSync。
|
|
2700
3165
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -2726,11 +3191,11 @@ export declare interface GetAppBaseInfoResult {
|
|
|
2726
3191
|
SDKVersion?: string;
|
|
2727
3192
|
/** 是否已打开调试 */
|
|
2728
3193
|
enableDebug?: boolean;
|
|
2729
|
-
/**
|
|
3194
|
+
/** 当前豆包客户端信息 */
|
|
2730
3195
|
host?: AppBaseInfoHost;
|
|
2731
3196
|
/** 当前语言 */
|
|
2732
3197
|
language: string;
|
|
2733
|
-
/**
|
|
3198
|
+
/** 豆包客户端版本号 */
|
|
2734
3199
|
version?: string;
|
|
2735
3200
|
/** 当前主题 */
|
|
2736
3201
|
theme?: 'light' | 'dark';
|
|
@@ -2739,7 +3204,7 @@ export declare interface GetAppBaseInfoResult {
|
|
|
2739
3204
|
/**
|
|
2740
3205
|
* 获取应用基础信息。
|
|
2741
3206
|
*
|
|
2742
|
-
* @returns 返回 SDK
|
|
3207
|
+
* @returns 返回 SDK 版本、调试开关、豆包客户端信息、语言和主题等字段,见 {@link GetAppBaseInfoResult}。
|
|
2743
3208
|
* @example
|
|
2744
3209
|
* ```typescript
|
|
2745
3210
|
* import { getAppBaseInfoSync } from '@doubao-dev/framework/api';
|
|
@@ -2752,6 +3217,8 @@ export declare interface GetAppBaseInfoResult {
|
|
|
2752
3217
|
*
|
|
2753
3218
|
* @since 0.0.18
|
|
2754
3219
|
* @contractStatus verified | 应用基础信息由智能服务运行环境同步读取,字段与公开类型一致。
|
|
3220
|
+
* @containerSupport Page | supported
|
|
3221
|
+
* @containerSupport Widget | supported
|
|
2755
3222
|
* @platformSupport Android | supported | 支持同步获取应用基础信息。
|
|
2756
3223
|
* @platformSupport iOS | supported | 支持同步获取应用基础信息。
|
|
2757
3224
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -2793,6 +3260,8 @@ export declare const getAppBaseInfoSync: (_params?: {}) => GetAppBaseInfoResult;
|
|
|
2793
3260
|
* ```
|
|
2794
3261
|
* @since 0.0.37
|
|
2795
3262
|
* @contractStatus verified | Android、iOS 均支持全局单例、背景播控、状态属性和事件监听
|
|
3263
|
+
* @containerSupport Page | supported
|
|
3264
|
+
* @containerSupport Widget | unsupported
|
|
2796
3265
|
* @platformSupport Android | supported | 支持背景音频播放和系统媒体控件
|
|
2797
3266
|
* @platformSupport iOS | supported | 支持背景音频播放和系统媒体控件
|
|
2798
3267
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -2850,6 +3319,8 @@ export declare function getBackgroundAudioManager(): BackgroundAudioManager;
|
|
|
2850
3319
|
* @since 0.0.25
|
|
2851
3320
|
* @contractStatus conflict | level 电量取值范围双端不一致,无法从公开类型判断实际区间
|
|
2852
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
|
|
2853
3324
|
* @platformSupport Android | supported | 支持获取电池信息
|
|
2854
3325
|
* @platformSupport iOS | supported | 支持获取电池信息
|
|
2855
3326
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -2900,6 +3371,8 @@ export declare interface GetBatteryInfoResult {
|
|
|
2900
3371
|
* @since 0.0.25
|
|
2901
3372
|
* @contractStatus verified | 返回的 beacons 列表字段与公开类型一致;双端权限与失败行为不同但不影响公开契约
|
|
2902
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
|
|
2903
3376
|
* @platformSupport Android | supported | 支持获取已搜索到的 iBeacon 列表
|
|
2904
3377
|
* @platformSupport iOS | supported | 支持获取已搜索到的 iBeacon 列表
|
|
2905
3378
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -2968,6 +3441,8 @@ export declare interface GetBeaconsResult {
|
|
|
2968
3441
|
*
|
|
2969
3442
|
* @since 0.0.25
|
|
2970
3443
|
* @contractStatus verified | BLE 特征值列表的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
3444
|
+
* @containerSupport Page | supported
|
|
3445
|
+
* @containerSupport Widget | unsupported
|
|
2971
3446
|
* @platformSupport Android | supported | 支持获取 BLE 特征值列表
|
|
2972
3447
|
* @platformSupport iOS | supported | 支持获取 BLE 特征值列表
|
|
2973
3448
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3038,6 +3513,8 @@ export declare interface GetBLEDeviceCharacteristicsResult {
|
|
|
3038
3513
|
*
|
|
3039
3514
|
* @since 0.0.25
|
|
3040
3515
|
* @contractStatus verified | BLE RSSI 的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
3516
|
+
* @containerSupport Page | supported
|
|
3517
|
+
* @containerSupport Widget | unsupported
|
|
3041
3518
|
* @platformSupport Android | supported | 支持获取 BLE 设备 RSSI
|
|
3042
3519
|
* @platformSupport iOS | supported | 支持获取 BLE 设备 RSSI
|
|
3043
3520
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3096,6 +3573,8 @@ export declare interface GetBLEDeviceRSSIResult {
|
|
|
3096
3573
|
*
|
|
3097
3574
|
* @since 0.0.25
|
|
3098
3575
|
* @contractStatus verified | BLE 服务列表的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
3576
|
+
* @containerSupport Page | supported
|
|
3577
|
+
* @containerSupport Widget | unsupported
|
|
3099
3578
|
* @platformSupport Android | supported | 支持获取 BLE 服务列表
|
|
3100
3579
|
* @platformSupport iOS | supported | 支持获取 BLE 服务列表
|
|
3101
3580
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3157,6 +3636,8 @@ export declare interface GetBLEDeviceServicesResult {
|
|
|
3157
3636
|
*
|
|
3158
3637
|
* @since 0.0.25
|
|
3159
3638
|
* @contractStatus verified | 获取 BLE MTU 的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
3639
|
+
* @containerSupport Page | supported
|
|
3640
|
+
* @containerSupport Widget | unsupported
|
|
3160
3641
|
* @platformSupport Android | supported | 支持获取 BLE MTU
|
|
3161
3642
|
* @platformSupport iOS | supported | 支持获取 BLE MTU
|
|
3162
3643
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3219,6 +3700,8 @@ export declare interface GetBLEMTUResult {
|
|
|
3219
3700
|
*
|
|
3220
3701
|
* @since 0.0.25
|
|
3221
3702
|
* @contractStatus verified | 蓝牙适配器状态的返回结构已与 Android、iOS 当前实现对齐
|
|
3703
|
+
* @containerSupport Page | supported
|
|
3704
|
+
* @containerSupport Widget | unsupported
|
|
3222
3705
|
* @platformSupport Android | supported | 支持获取蓝牙适配器状态
|
|
3223
3706
|
* @platformSupport iOS | supported | 支持获取蓝牙适配器状态
|
|
3224
3707
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3269,6 +3752,8 @@ export declare interface GetBluetoothAdapterStateResult {
|
|
|
3269
3752
|
*
|
|
3270
3753
|
* @since 0.0.25
|
|
3271
3754
|
* @contractStatus verified | 已发现设备列表的返回结构已与 Android、iOS 当前实现对齐;广播二进制字段由框架统一解码为 ArrayBuffer
|
|
3755
|
+
* @containerSupport Page | supported
|
|
3756
|
+
* @containerSupport Widget | unsupported
|
|
3272
3757
|
* @platformSupport Android | supported | 支持获取已发现的蓝牙设备列表
|
|
3273
3758
|
* @platformSupport iOS | supported | 支持获取已发现的蓝牙设备列表
|
|
3274
3759
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3307,6 +3792,42 @@ export declare interface GetBluetoothDevicesResult {
|
|
|
3307
3792
|
devices: BluetoothDevice[];
|
|
3308
3793
|
}
|
|
3309
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
|
+
|
|
3310
3831
|
/**
|
|
3311
3832
|
* 获取剪贴板内容。
|
|
3312
3833
|
*
|
|
@@ -3321,6 +3842,8 @@ export declare interface GetBluetoothDevicesResult {
|
|
|
3321
3842
|
*
|
|
3322
3843
|
* @since 0.0.25
|
|
3323
3844
|
* @contractStatus verified | data 字段的类型与必返性已与 Android、iOS 当前实现对齐
|
|
3845
|
+
* @containerSupport Page | supported
|
|
3846
|
+
* @containerSupport Widget | supported
|
|
3324
3847
|
* @platformSupport Android | supported | 支持读取剪贴板
|
|
3325
3848
|
* @platformSupport iOS | supported | 支持读取剪贴板
|
|
3326
3849
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3375,6 +3898,8 @@ export declare interface GetClipboardDataResult {
|
|
|
3375
3898
|
*
|
|
3376
3899
|
* @since 0.0.25
|
|
3377
3900
|
* @contractStatus verified | 已连接设备列表的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
3901
|
+
* @containerSupport Page | supported
|
|
3902
|
+
* @containerSupport Widget | unsupported
|
|
3378
3903
|
* @platformSupport Android | supported | 支持获取已连接的蓝牙设备列表
|
|
3379
3904
|
* @platformSupport iOS | supported | 支持获取已连接的蓝牙设备列表
|
|
3380
3905
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3438,6 +3963,8 @@ export declare interface GetConnectedBluetoothDevicesResult {
|
|
|
3438
3963
|
* @contractStatus conflict | 双端均可获取已连接 Wi-Fi,但 signalStrength 量纲不一致且 iOS 无 frequency
|
|
3439
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 量纲
|
|
3440
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
|
|
3441
3968
|
* @platformSupport Android | supported | 支持获取已连接 Wi-Fi,signalStrength 为 0 到 100
|
|
3442
3969
|
* @platformSupport iOS | supported | 支持获取已连接 Wi-Fi,signalStrength 为 0 到 1 且无 frequency
|
|
3443
3970
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3524,6 +4051,8 @@ export declare interface GetConnectedWifiResult {
|
|
|
3524
4051
|
* ```
|
|
3525
4052
|
* @since 0.0.32
|
|
3526
4053
|
* @contractStatus verified | 设备信息字段的类型、必返性与平台可选性已与 Android、iOS 当前实现对齐
|
|
4054
|
+
* @containerSupport Page | supported
|
|
4055
|
+
* @containerSupport Widget | supported
|
|
3527
4056
|
* @platformSupport Android | supported | 支持获取设备信息
|
|
3528
4057
|
* @platformSupport iOS | supported | 支持获取设备信息
|
|
3529
4058
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3555,7 +4084,7 @@ export declare const getDeviceInfo: (params?: {} | undefined) => Promise<GetDevi
|
|
|
3555
4084
|
* @public
|
|
3556
4085
|
*/
|
|
3557
4086
|
export declare interface GetDeviceInfoResult {
|
|
3558
|
-
/**
|
|
4087
|
+
/** 豆包客户端二进制接口类型,仅 Android 支持。 */
|
|
3559
4088
|
abi?: string;
|
|
3560
4089
|
/** 设备二进制接口类型,仅 Android 支持。 */
|
|
3561
4090
|
deviceAbi?: string;
|
|
@@ -3590,13 +4119,15 @@ export declare interface GetDeviceInfoResult {
|
|
|
3590
4119
|
* ```
|
|
3591
4120
|
* @since 0.0.32
|
|
3592
4121
|
* @contractStatus verified | 同步设备信息由智能服务运行环境 globalProps 读取,字段类型与公开类型一致
|
|
4122
|
+
* @containerSupport Page | supported
|
|
4123
|
+
* @containerSupport Widget | supported
|
|
3593
4124
|
* @platformSupport Android | supported | 支持同步获取设备信息
|
|
3594
4125
|
* @platformSupport iOS | supported | 支持同步获取设备信息
|
|
3595
4126
|
* @platformSupport PC | unsupported | 暂不支持
|
|
3596
4127
|
* @platformSupport HarmonyOS | unsupported | 暂不支持
|
|
3597
4128
|
* @permission none | - | none | Android,iOS | 无需额外权限
|
|
3598
4129
|
* @precondition All | 无额外前置条件
|
|
3599
|
-
* @usageNote All | `benchmarkLevel`、`memorySize`、`deviceAbi` 和 `cpuType`
|
|
4130
|
+
* @usageNote All | `platform` 优先取自 globalProps.platform,未注入时由 globalProps.os 推导;`benchmarkLevel`、`memorySize`、`deviceAbi` 和 `cpuType` 也取自 globalProps
|
|
3600
4131
|
* @platformNote Android | `abi`、`deviceAbi`、`cpuType` 仅在运行环境注入对应 globalProps 字段时返回
|
|
3601
4132
|
* @platformNote iOS | 未注入时不返回 `abi`、`deviceAbi`、`cpuType`
|
|
3602
4133
|
* @resultExample
|
|
@@ -3674,6 +4205,8 @@ export declare interface GetFileInfoResult {
|
|
|
3674
4205
|
* @since 0.0.31
|
|
3675
4206
|
* @contractStatus verified | Android、iOS 均支持文件系统管理器的读写、目录、状态、保存与解压能力,同步与异步方法行为一致
|
|
3676
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
|
|
3677
4210
|
* @platformSupport Android | supported | 支持全部读写、目录、状态、保存与解压方法,同步与异步均可用
|
|
3678
4211
|
* @platformSupport iOS | supported | 支持全部读写、目录、状态、保存与解压方法,同步与异步均可用
|
|
3679
4212
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3715,6 +4248,8 @@ export declare function getFileSystemManager(): FileSystemManager;
|
|
|
3715
4248
|
* ```
|
|
3716
4249
|
* @since 0.0.26
|
|
3717
4250
|
* @contractStatus verified | Android、iOS 的入参、图片尺寸、方向、格式和路径返回结构一致
|
|
4251
|
+
* @containerSupport Page | supported
|
|
4252
|
+
* @containerSupport Widget | unsupported
|
|
3718
4253
|
* @platformSupport Android | supported | 支持读取本地图片和 HTTP、HTTPS 网络图片信息
|
|
3719
4254
|
* @platformSupport iOS | supported | 支持读取本地图片和 HTTP、HTTPS 网络图片信息
|
|
3720
4255
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3808,6 +4343,8 @@ export declare interface GetImageInfoResult {
|
|
|
3808
4343
|
* @contractStatus verified | 文档入参与返回字段可选性已与 Android、iOS 当前实现对齐
|
|
3809
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 是否主动申请权限
|
|
3810
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
|
|
3811
4348
|
* @platformSupport Android | supported | 支持获取设备当前位置
|
|
3812
4349
|
* @platformSupport iOS | supported | 支持获取设备当前位置
|
|
3813
4350
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -3867,6 +4404,13 @@ export declare interface GetLocationParams {
|
|
|
3867
4404
|
* @constraint 取值为 0、1 或 2
|
|
3868
4405
|
*/
|
|
3869
4406
|
mode?: number;
|
|
4407
|
+
/**
|
|
4408
|
+
* 是否接受轻定位结果。轻定位会直接利用设备已有的 Wi-Fi 扫描缓存,由服务端快速计算当前位置,缩短定位耗时。
|
|
4409
|
+
*
|
|
4410
|
+
* @default false
|
|
4411
|
+
* @constraint 仅 Android 生效,需使用 0.0.42 及以上版本的基础库
|
|
4412
|
+
*/
|
|
4413
|
+
acceptLightLocation?: boolean;
|
|
3870
4414
|
/**
|
|
3871
4415
|
* 超时时间,单位毫秒,默认 30000
|
|
3872
4416
|
*
|
|
@@ -3922,6 +4466,8 @@ export declare interface GetLocationResponse {
|
|
|
3922
4466
|
*
|
|
3923
4467
|
* @since 0.0.26
|
|
3924
4468
|
* @contractStatus verified | 返回值由当前窗口、安全区域和设备类型同步计算,与 Android、iOS 胶囊按钮布局规则一致。
|
|
4469
|
+
* @containerSupport Page | supported
|
|
4470
|
+
* @containerSupport Widget | unsupported
|
|
3925
4471
|
* @platformSupport Android | supported | 支持获取菜单按钮布局信息。
|
|
3926
4472
|
* @platformSupport iOS | supported | 支持获取菜单按钮布局信息。
|
|
3927
4473
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -3963,6 +4509,8 @@ export declare const getMenuButtonBoundingClientRect: () => MenuButtonBoundingCl
|
|
|
3963
4509
|
* @contractStatus conflict | networkType 取值及 signalStrength/weakNet 的返回条件双端不一致,无法从公开类型判断实际结果
|
|
3964
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 | 统一双端网络类型取值集合
|
|
3965
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
|
|
3966
4514
|
* @platformSupport Android | supported | 支持获取网络类型
|
|
3967
4515
|
* @platformSupport iOS | supported | 支持获取网络类型
|
|
3968
4516
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -4055,6 +4603,8 @@ export declare interface GetNetworkTypeResult {
|
|
|
4055
4603
|
*
|
|
4056
4604
|
* @since 0.0.28
|
|
4057
4605
|
* @contractStatus verified | 公开成功返回结构与 Android、iOS 一致;失败通过 Promise reject,业务错误在错误对象的 data 字段。
|
|
4606
|
+
* @containerSupport Page | supported
|
|
4607
|
+
* @containerSupport Widget | supported
|
|
4058
4608
|
* @platformSupport Android | supported | 支持拉起收银台完成订单支付。
|
|
4059
4609
|
* @platformSupport iOS | supported | 支持拉起收银台完成订单支付。
|
|
4060
4610
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -4138,6 +4688,8 @@ export declare interface GetOrderPaymentResult {
|
|
|
4138
4688
|
*
|
|
4139
4689
|
* @since 0.0.28
|
|
4140
4690
|
* @contractStatus verified | 公开成功返回结构与 Android、iOS 一致;失败通过 Promise reject,业务错误在错误对象的 data 字段。
|
|
4691
|
+
* @containerSupport Page | supported
|
|
4692
|
+
* @containerSupport Widget | supported
|
|
4141
4693
|
* @platformSupport Android | supported | 支持携带签名信息拉起收银台完成订单支付。
|
|
4142
4694
|
* @platformSupport iOS | supported | 支持携带签名信息拉起收银台完成订单支付。
|
|
4143
4695
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -4207,39 +4759,64 @@ export declare interface GetPackageInfoResult {
|
|
|
4207
4759
|
}
|
|
4208
4760
|
|
|
4209
4761
|
/**
|
|
4210
|
-
* 同步获取当前 package
|
|
4762
|
+
* 同步获取当前 package 信息,仅供 Web SDK 模拟器使用。
|
|
4211
4763
|
*
|
|
4212
|
-
* @
|
|
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。
|
|
4774
|
+
*
|
|
4775
|
+
* @returns 返回可查询性能 Entry 和创建观察者的 {@link Performance}。
|
|
4213
4776
|
* @example
|
|
4214
4777
|
* ```typescript
|
|
4215
|
-
* import {
|
|
4778
|
+
* import { getPerformance } from '@doubao-dev/framework/api';
|
|
4216
4779
|
*
|
|
4217
|
-
* const
|
|
4780
|
+
* const performance = getPerformance();
|
|
4781
|
+
* const observer = performance.createObserver((entryList) => {
|
|
4782
|
+
* console.log(entryList.getEntries());
|
|
4783
|
+
* });
|
|
4218
4784
|
*
|
|
4219
|
-
*
|
|
4785
|
+
* performance.setBufferSize(100);
|
|
4786
|
+
* observer.observe({ entryTypes: ['render'] });
|
|
4787
|
+
* console.log(performance.getEntriesByType('render'));
|
|
4788
|
+
* observer.disconnect();
|
|
4220
4789
|
* ```
|
|
4221
4790
|
*
|
|
4222
|
-
* @since 0.0.
|
|
4223
|
-
* @contractStatus verified |
|
|
4224
|
-
* @
|
|
4225
|
-
* @
|
|
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、设置性能缓冲区大小和创建性能观察者。
|
|
4226
4797
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
4227
4798
|
* @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
|
|
4228
4799
|
* @permission none | - | none | Android,iOS | 无需额外权限
|
|
4229
4800
|
* @precondition All | 无额外前置条件
|
|
4801
|
+
* @usageNote All | 仅在需要接收后续新完成的 Entry 时创建 observer;不再需要时调用 disconnect。
|
|
4230
4802
|
* @resultExample
|
|
4231
4803
|
* ```json
|
|
4232
|
-
*
|
|
4233
|
-
*
|
|
4234
|
-
*
|
|
4235
|
-
*
|
|
4236
|
-
*
|
|
4804
|
+
* [
|
|
4805
|
+
* {
|
|
4806
|
+
* "entryType": "render",
|
|
4807
|
+
* "name": "firstRender",
|
|
4808
|
+
* "startTime": 1730000000000,
|
|
4809
|
+
* "duration": 42,
|
|
4810
|
+
* "path": "pages/index/index",
|
|
4811
|
+
* "pageId": 1
|
|
4812
|
+
* }
|
|
4813
|
+
* ]
|
|
4237
4814
|
* ```
|
|
4238
4815
|
* @errorCode none | - | - | Android,iOS | 无 API 专属错误码 | 无需处理
|
|
4239
4816
|
*
|
|
4240
4817
|
* @public
|
|
4241
4818
|
*/
|
|
4242
|
-
export declare
|
|
4819
|
+
export declare function getPerformance(): Performance_2;
|
|
4243
4820
|
|
|
4244
4821
|
/**
|
|
4245
4822
|
* 获取隐私设置状态。
|
|
@@ -4256,6 +4833,8 @@ export declare const getPackageInfoSync: () => GetPackageInfoResult;
|
|
|
4256
4833
|
*
|
|
4257
4834
|
* @since 0.0.19
|
|
4258
4835
|
* @contractStatus verified | 公开定义与 Android、iOS 的成功、失败路径一致。
|
|
4836
|
+
* @containerSupport Page | supported
|
|
4837
|
+
* @containerSupport Widget | supported
|
|
4259
4838
|
* @platformSupport Android | supported | 支持获取隐私协议授权状态。
|
|
4260
4839
|
* @platformSupport iOS | supported | 支持获取隐私协议授权状态。
|
|
4261
4840
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -4292,6 +4871,8 @@ export declare const getPrivacySetting: (params?: {} | undefined) => Promise<Pri
|
|
|
4292
4871
|
*
|
|
4293
4872
|
* @since 0.0.25
|
|
4294
4873
|
* @contractStatus verified | 由前端基于 Crypto.getRandomValues 实现,入参校验与返回结构在各端一致
|
|
4874
|
+
* @containerSupport Page | supported
|
|
4875
|
+
* @containerSupport Widget | unsupported
|
|
4295
4876
|
* @platformSupport Android | supported | 支持获取安全随机数
|
|
4296
4877
|
* @platformSupport iOS | supported | 支持获取安全随机数
|
|
4297
4878
|
* @platformSupport PC | supported | 支持获取安全随机数
|
|
@@ -4350,6 +4931,8 @@ export declare interface GetRandomValuesResult {
|
|
|
4350
4931
|
* @since 0.0.36
|
|
4351
4932
|
* @contractStatus verified | Android、iOS 均支持单例录音管理、授权、状态事件、停止结果和可选分片事件
|
|
4352
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
|
|
4353
4936
|
* @platformSupport Android | supported | 支持 AAC 录音和带 frameSize 的 PCM/WAV 分片录音
|
|
4354
4937
|
* @platformSupport iOS | supported | 支持 AAC、PCM/WAV 录音和带 frameSize 的分片录音
|
|
4355
4938
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -4404,6 +4987,8 @@ export declare interface GetSavedFileListResult {
|
|
|
4404
4987
|
* @since 0.0.19
|
|
4405
4988
|
* @contractStatus conflict | 豆包 iOS 未注册该接口,仅 Android 可调用
|
|
4406
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
|
|
4407
4992
|
* @platformSupport Android | supported | 支持获取屏幕亮度
|
|
4408
4993
|
* @platformSupport iOS | unsupported | 豆包 iOS 未实现获取屏幕亮度接口
|
|
4409
4994
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -4448,12 +5033,15 @@ export declare interface GetScreenBrightnessResult {
|
|
|
4448
5033
|
*
|
|
4449
5034
|
* @since 0.0.36
|
|
4450
5035
|
* @contractStatus verified | withSubscriptions 当前仅允许 false,Android、iOS 均支持返回授权设置。
|
|
5036
|
+
* @containerSupport Page | supported
|
|
5037
|
+
* @containerSupport Widget | supported
|
|
4451
5038
|
* @platformSupport Android | supported | 支持获取用户的应用授权设置。
|
|
4452
5039
|
* @platformSupport iOS | supported | 支持获取用户的应用授权设置。
|
|
4453
5040
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
4454
5041
|
* @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
|
|
4455
5042
|
* @permission none | - | none | Android,iOS | 无需额外权限
|
|
4456
5043
|
* @precondition All | 无额外前置条件
|
|
5044
|
+
* @usageNote All | authSetting 只表示当前智能服务的 scope 授权,不表示宿主系统权限;HealthKit 逐类型系统状态通过 getAppAuthorizeSetting 查询。
|
|
4457
5045
|
* @usageNote All | authSetting 只包含已向用户请求过且状态明确的权限;豆包当前不支持订阅模板,不要传入 withSubscriptions: true。
|
|
4458
5046
|
* @resultExample
|
|
4459
5047
|
* ```json
|
|
@@ -4495,7 +5083,7 @@ export declare interface GetSettingParams {
|
|
|
4495
5083
|
export declare interface GetSettingResult {
|
|
4496
5084
|
/** 用户授权结果,key 为权限 scope,value 表示是否已授权 */
|
|
4497
5085
|
authSetting: AuthSetting;
|
|
4498
|
-
/**
|
|
5086
|
+
/** 预留的订阅消息设置字段。豆包当前仅支持 `withSubscriptions: false`,因此不会返回该字段。 */
|
|
4499
5087
|
subscriptionsSetting?: SubscriptionsSetting;
|
|
4500
5088
|
}
|
|
4501
5089
|
|
|
@@ -4518,6 +5106,8 @@ export declare interface GetSettingResult {
|
|
|
4518
5106
|
* @since 0.0.17
|
|
4519
5107
|
* @contractStatus conflict | key 不存在时双端返回空值且判定成功,与公开必返 data 类型冲突。
|
|
4520
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
|
|
4521
5111
|
* @platformSupport Android | supported | 支持按智能服务维度读取本地缓存。
|
|
4522
5112
|
* @platformSupport iOS | supported | 支持按智能服务维度读取本地缓存。
|
|
4523
5113
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -4564,6 +5154,8 @@ export declare function getStorage<TData = unknown>(params: GetStorageParams): P
|
|
|
4564
5154
|
*
|
|
4565
5155
|
* @since 0.0.17
|
|
4566
5156
|
* @contractStatus verified | 返回字段、单位及 Android、iOS 错误字段已核对一致。
|
|
5157
|
+
* @containerSupport Page | supported
|
|
5158
|
+
* @containerSupport Widget | supported
|
|
4567
5159
|
* @platformSupport Android | supported | 支持查询当前智能服务的本地缓存信息。
|
|
4568
5160
|
* @platformSupport iOS | supported | 支持查询当前智能服务的本地缓存信息。
|
|
4569
5161
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -4610,6 +5202,8 @@ export declare interface GetStorageInfoResult {
|
|
|
4610
5202
|
*
|
|
4611
5203
|
* @since 0.0.19
|
|
4612
5204
|
* @contractStatus verified | 返回字段、单位及 Android、iOS 错误字段已核对一致。
|
|
5205
|
+
* @containerSupport Page | supported
|
|
5206
|
+
* @containerSupport Widget | supported
|
|
4613
5207
|
* @platformSupport Android | supported | 支持同步查询当前智能服务的本地缓存信息。
|
|
4614
5208
|
* @platformSupport iOS | supported | 支持同步查询当前智能服务的本地缓存信息。
|
|
4615
5209
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -4662,6 +5256,8 @@ export declare interface GetStorageResult<TData = unknown> {
|
|
|
4662
5256
|
* @since 0.0.19
|
|
4663
5257
|
* @contractStatus conflict | key 不存在时双端返回空值且判定成功,与公开必返 data 类型冲突。
|
|
4664
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
|
|
4665
5261
|
* @platformSupport Android | supported | 支持按智能服务维度同步读取本地缓存。
|
|
4666
5262
|
* @platformSupport iOS | supported | 支持按智能服务维度同步读取本地缓存。
|
|
4667
5263
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -4696,7 +5292,7 @@ export declare function getStorageSync<TData = unknown>(params: GetStorageParams
|
|
|
4696
5292
|
/**
|
|
4697
5293
|
* 获取系统信息。
|
|
4698
5294
|
*
|
|
4699
|
-
* @returns
|
|
5295
|
+
* @returns 返回设备品牌、型号、屏幕尺寸、豆包客户端信息和安全区域等字段,见 {@link GetSystemInfoResult}。
|
|
4700
5296
|
* @example
|
|
4701
5297
|
* ```typescript
|
|
4702
5298
|
* import { getSystemInfo } from '@doubao-dev/framework/api';
|
|
@@ -4709,7 +5305,9 @@ export declare function getStorageSync<TData = unknown>(params: GetStorageParams
|
|
|
4709
5305
|
*
|
|
4710
5306
|
* @since 0.0.34
|
|
4711
5307
|
* @contractStatus verified | 设备品牌、屏幕尺寸、系统信息和安全区域等字段与公开类型一致。
|
|
4712
|
-
* @contractMismatch non-blocking | return | abi | Android,iOS | abi
|
|
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
|
|
4713
5311
|
* @platformSupport Android | supported | 支持获取系统信息。
|
|
4714
5312
|
* @platformSupport iOS | supported | 支持获取系统信息。
|
|
4715
5313
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -4748,7 +5346,7 @@ export declare function getStorageSync<TData = unknown>(params: GetStorageParams
|
|
|
4748
5346
|
* }
|
|
4749
5347
|
* ```
|
|
4750
5348
|
* @errorCode common | 102 | Android
|
|
4751
|
-
* @platformNote Android | abi
|
|
5349
|
+
* @platformNote Android | abi 返回豆包客户端二进制接口类型(如 arm64-v8a),iOS 不返回该字段
|
|
4752
5350
|
*
|
|
4753
5351
|
* @public
|
|
4754
5352
|
*/
|
|
@@ -4774,7 +5372,7 @@ export declare interface GetSystemInfoResult {
|
|
|
4774
5372
|
statusBarHeight: number;
|
|
4775
5373
|
/** 系统语言,格式为 language_region,如 zh_CN、en_US */
|
|
4776
5374
|
language: string;
|
|
4777
|
-
/**
|
|
5375
|
+
/** 豆包客户端版本号 */
|
|
4778
5376
|
version?: string;
|
|
4779
5377
|
/** 操作系统及版本,如 "Android 14"、"iOS 17.5" */
|
|
4780
5378
|
system: string;
|
|
@@ -4792,14 +5390,14 @@ export declare interface GetSystemInfoResult {
|
|
|
4792
5390
|
enableDebug?: boolean;
|
|
4793
5391
|
/** 设备方向 */
|
|
4794
5392
|
deviceOrientation?: 'portrait' | 'landscape';
|
|
4795
|
-
/**
|
|
5393
|
+
/** 豆包客户端二进制接口类型(如 arm64-v8a),仅 Android 返回 */
|
|
4796
5394
|
abi?: string;
|
|
4797
5395
|
}
|
|
4798
5396
|
|
|
4799
5397
|
/**
|
|
4800
5398
|
* 同步获取系统信息。
|
|
4801
5399
|
*
|
|
4802
|
-
* @returns
|
|
5400
|
+
* @returns 返回设备品牌、型号、屏幕尺寸、豆包客户端信息和安全区域等字段,见 {@link GetSystemInfoResult}。
|
|
4803
5401
|
* @example
|
|
4804
5402
|
* ```typescript
|
|
4805
5403
|
* import { getSystemInfoSync } from '@doubao-dev/framework/api';
|
|
@@ -4812,7 +5410,9 @@ export declare interface GetSystemInfoResult {
|
|
|
4812
5410
|
*
|
|
4813
5411
|
* @since 0.0.34
|
|
4814
5412
|
* @contractStatus verified | 设备品牌、屏幕尺寸、系统信息和安全区域等字段与公开类型一致。
|
|
4815
|
-
* @contractMismatch non-blocking | return | abi | Android,iOS | abi
|
|
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
|
|
4816
5416
|
* @platformSupport Android | supported | 支持同步获取系统信息。
|
|
4817
5417
|
* @platformSupport iOS | supported | 支持同步获取系统信息。
|
|
4818
5418
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -4851,7 +5451,7 @@ export declare interface GetSystemInfoResult {
|
|
|
4851
5451
|
* }
|
|
4852
5452
|
* ```
|
|
4853
5453
|
* @errorCode common | 102 | Android
|
|
4854
|
-
* @platformNote Android | abi
|
|
5454
|
+
* @platformNote Android | abi 返回豆包客户端二进制接口类型(如 arm64-v8a),iOS 不返回该字段
|
|
4855
5455
|
*
|
|
4856
5456
|
* @public
|
|
4857
5457
|
*/
|
|
@@ -4874,6 +5474,8 @@ export declare const getSystemInfoSync: (_params?: {}) => GetSystemInfoResult;
|
|
|
4874
5474
|
* @since 0.0.25
|
|
4875
5475
|
* @contractStatus verified | 蓝牙、定位、Wi-Fi 和设备方向字段与公开类型一致,均可稳定返回。
|
|
4876
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
|
|
4877
5479
|
* @platformSupport Android | supported | 支持获取设备系统设置。
|
|
4878
5480
|
* @platformSupport iOS | supported | 支持获取设备系统设置。
|
|
4879
5481
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -4927,6 +5529,8 @@ export declare interface GetSystemSettingResult {
|
|
|
4927
5529
|
* @since 0.0.25
|
|
4928
5530
|
* @contractStatus conflict | 双端均可调用,但 Android 返回扫描到的周边 Wi-Fi,iOS 仅返回当前连接
|
|
4929
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
|
|
4930
5534
|
* @platformSupport Android | supported | 支持扫描并返回周边 Wi-Fi 列表
|
|
4931
5535
|
* @platformSupport iOS | supported | 仅返回当前已连接的 Wi-Fi
|
|
4932
5536
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -5002,6 +5606,8 @@ export declare interface GetWifiListResult {
|
|
|
5002
5606
|
*
|
|
5003
5607
|
* @since 0.0.18
|
|
5004
5608
|
* @contractStatus verified | 窗口信息由智能服务运行环境读取,字段与公开类型一致。
|
|
5609
|
+
* @containerSupport Page | supported
|
|
5610
|
+
* @containerSupport Widget | unsupported
|
|
5005
5611
|
* @platformSupport Android | supported | 支持获取窗口信息。
|
|
5006
5612
|
* @platformSupport iOS | supported | 支持获取窗口信息。
|
|
5007
5613
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -5071,6 +5677,8 @@ export declare interface GetWindowInfoResult {
|
|
|
5071
5677
|
*
|
|
5072
5678
|
* @since 0.0.18
|
|
5073
5679
|
* @contractStatus verified | 窗口信息由智能服务运行环境同步读取,字段与公开类型一致。
|
|
5680
|
+
* @containerSupport Page | supported
|
|
5681
|
+
* @containerSupport Widget | unsupported
|
|
5074
5682
|
* @platformSupport Android | supported | 支持同步获取窗口信息。
|
|
5075
5683
|
* @platformSupport iOS | supported | 支持同步获取窗口信息。
|
|
5076
5684
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -5126,6 +5734,40 @@ export declare interface GyroscopeChangeEvent {
|
|
|
5126
5734
|
*/
|
|
5127
5735
|
export declare type GyroscopeChangeListener = (event: GyroscopeChangeEvent) => void;
|
|
5128
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
|
+
|
|
5129
5771
|
/**
|
|
5130
5772
|
* 隐藏交互提示框的公共参数。
|
|
5131
5773
|
*
|
|
@@ -5146,6 +5788,8 @@ export declare interface HideInteractionParams {
|
|
|
5146
5788
|
*
|
|
5147
5789
|
* @since 0.0.25
|
|
5148
5790
|
* @contractStatus verified | 无返回字段,与 Android、iOS 实现一致。
|
|
5791
|
+
* @containerSupport Page | supported
|
|
5792
|
+
* @containerSupport Widget | unsupported
|
|
5149
5793
|
* @platformSupport Android | supported | 支持收起当前键盘。
|
|
5150
5794
|
* @platformSupport iOS | supported | 支持收起当前键盘。
|
|
5151
5795
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -5175,6 +5819,8 @@ export declare interface HideKeyboardParam {
|
|
|
5175
5819
|
*
|
|
5176
5820
|
* @since 0.0.26
|
|
5177
5821
|
* @contractStatus verified | 无参数、无返回字段,与 Android、iOS 实现一致。
|
|
5822
|
+
* @containerSupport Page | supported
|
|
5823
|
+
* @containerSupport Widget | unsupported
|
|
5178
5824
|
* @platformSupport Android | supported | 支持隐藏当前 loading。
|
|
5179
5825
|
* @platformSupport iOS | supported | 支持隐藏当前 loading。
|
|
5180
5826
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -5200,6 +5846,8 @@ export declare const hideLoading: (params?: HideInteractionParams | undefined) =
|
|
|
5200
5846
|
*
|
|
5201
5847
|
* @since 0.0.26
|
|
5202
5848
|
* @contractStatus verified | 无参数、无返回字段,与 Android、iOS 实现一致。
|
|
5849
|
+
* @containerSupport Page | supported
|
|
5850
|
+
* @containerSupport Widget | supported
|
|
5203
5851
|
* @platformSupport Android | supported | 支持隐藏当前 Toast。
|
|
5204
5852
|
* @platformSupport iOS | supported | 支持隐藏当前 Toast。
|
|
5205
5853
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -5344,6 +5992,8 @@ export declare interface InnerAudioError {
|
|
|
5344
5992
|
* @since 0.0.25
|
|
5345
5993
|
* @contractStatus conflict | 豆包 iOS 未提供查询配对状态能力,仅 Android 可调用
|
|
5346
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
|
|
5347
5997
|
* @platformSupport Android | supported | 支持查询设备配对状态
|
|
5348
5998
|
* @platformSupport iOS | unsupported | 豆包 iOS 未实现查询配对状态,调用返回不支持
|
|
5349
5999
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -5404,6 +6054,19 @@ export declare interface KeyboardHeightChangeEvent {
|
|
|
5404
6054
|
/** @public */
|
|
5405
6055
|
export declare type KeyboardHeightChangeListener = (event: KeyboardHeightChangeEvent) => void;
|
|
5406
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
|
+
|
|
5407
6070
|
/** @public */
|
|
5408
6071
|
export declare interface LocationChangeErrorEvent {
|
|
5409
6072
|
/**
|
|
@@ -5486,6 +6149,8 @@ export declare type LocationOperationResult = Record<string, never>;
|
|
|
5486
6149
|
*
|
|
5487
6150
|
* @since 0.0.19
|
|
5488
6151
|
* @contractStatus verified | 公开参数、超时语义、返回结构及 Android、iOS 错误字段已核对一致。
|
|
6152
|
+
* @containerSupport Page | supported
|
|
6153
|
+
* @containerSupport Widget | supported
|
|
5489
6154
|
* @platformSupport Android | supported | 支持获取当前智能服务的一次性登录凭证。
|
|
5490
6155
|
* @platformSupport iOS | supported | 支持获取当前智能服务的一次性登录凭证。
|
|
5491
6156
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -5600,6 +6265,8 @@ export declare const LoginType: {
|
|
|
5600
6265
|
* @since 0.0.19
|
|
5601
6266
|
* @contractStatus conflict | loginType 的四个枚举语义未在 Android、iOS 完整实现。
|
|
5602
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
|
|
5603
6270
|
* @platformSupport Android | supported | 支持拉起豆包登录或隐私授权流程。
|
|
5604
6271
|
* @platformSupport iOS | supported | 支持拉起豆包登录或隐私授权流程。
|
|
5605
6272
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -5665,6 +6332,8 @@ export declare interface LoginWithWidgetResult {
|
|
|
5665
6332
|
* @since 0.0.25
|
|
5666
6333
|
* @contractStatus conflict | 豆包 iOS 未提供蓝牙配对能力,仅 Android 可调用
|
|
5667
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
|
|
5668
6337
|
* @platformSupport Android | supported | 支持发起蓝牙配对
|
|
5669
6338
|
* @platformSupport iOS | unsupported | 豆包 iOS 未实现蓝牙配对,调用返回不支持
|
|
5670
6339
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -5722,6 +6391,8 @@ export declare interface MakeBluetoothPairParams {
|
|
|
5722
6391
|
* @since 0.0.19
|
|
5723
6392
|
* @contractStatus conflict | 拨号成功语义双端不一致
|
|
5724
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
|
|
5725
6396
|
* @platformSupport Android | supported | 支持唤起系统拨号
|
|
5726
6397
|
* @platformSupport iOS | supported | 支持唤起系统拨号
|
|
5727
6398
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -5774,6 +6445,13 @@ export declare interface MenuButtonBoundingClientRect {
|
|
|
5774
6445
|
left: number;
|
|
5775
6446
|
}
|
|
5776
6447
|
|
|
6448
|
+
/**
|
|
6449
|
+
* 麦克风精细授权状态,取值与 {@link BasicAuthorizationDetail} 一致。
|
|
6450
|
+
*
|
|
6451
|
+
* @public
|
|
6452
|
+
*/
|
|
6453
|
+
export declare type MicrophoneAuthorizationDetail = BasicAuthorizationDetail;
|
|
6454
|
+
|
|
5777
6455
|
/**
|
|
5778
6456
|
* {@link FileSystemManager.mkdir} 的参数。
|
|
5779
6457
|
*
|
|
@@ -5808,6 +6486,8 @@ export declare interface MkdirParams {
|
|
|
5808
6486
|
*
|
|
5809
6487
|
* @since 0.0.19
|
|
5810
6488
|
* @contractStatus verified | 公开参数、返回语义及 Android、iOS 失败字段已核对一致。
|
|
6489
|
+
* @containerSupport Page | supported
|
|
6490
|
+
* @containerSupport Widget | unsupported
|
|
5811
6491
|
* @platformSupport Android | supported | 支持在页面栈内返回指定层数。
|
|
5812
6492
|
* @platformSupport iOS | supported | 支持在页面栈内返回指定层数。
|
|
5813
6493
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -5845,6 +6525,8 @@ export declare interface NavigateBackParams {
|
|
|
5845
6525
|
*
|
|
5846
6526
|
* @since 0.0.19
|
|
5847
6527
|
* @contractStatus verified | 公开参数、跳转语义及 Android、iOS 失败字段已核对一致。
|
|
6528
|
+
* @containerSupport Page | supported
|
|
6529
|
+
* @containerSupport Widget | supported
|
|
5848
6530
|
* @platformSupport Android | supported | 支持在当前智能服务内跳转到指定页面。
|
|
5849
6531
|
* @platformSupport iOS | supported | 支持在当前智能服务内跳转到指定页面。
|
|
5850
6532
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -5906,6 +6588,16 @@ export declare type NetworkStatusChangeListener = (event: NetworkStatusChangeEve
|
|
|
5906
6588
|
*/
|
|
5907
6589
|
export declare type NetworkType = 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown' | 'none';
|
|
5908
6590
|
|
|
6591
|
+
/**
|
|
6592
|
+
* 通知精细授权状态。
|
|
6593
|
+
*
|
|
6594
|
+
* 继承 {@link BasicAuthorizationDetail} 的全部取值,并增加:
|
|
6595
|
+
* - `provisional`:iOS 临时静默授权;不会弹出授权框,通知只进入通知中心。
|
|
6596
|
+
*
|
|
6597
|
+
* @public
|
|
6598
|
+
*/
|
|
6599
|
+
export declare type NotificationAuthorizationDetail = BasicAuthorizationDetail | 'provisional';
|
|
6600
|
+
|
|
5909
6601
|
/**
|
|
5910
6602
|
* 订阅 BLE 特征值变化。
|
|
5911
6603
|
*
|
|
@@ -5926,6 +6618,8 @@ export declare type NetworkType = 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown'
|
|
|
5926
6618
|
* @returns 不包含字段的结果对象。
|
|
5927
6619
|
* @since 0.0.25
|
|
5928
6620
|
* @contractStatus verified | 订阅特征值变化的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
6621
|
+
* @containerSupport Page | supported
|
|
6622
|
+
* @containerSupport Widget | unsupported
|
|
5929
6623
|
* @platformSupport Android | supported | 支持订阅 BLE 特征值变化
|
|
5930
6624
|
* @platformSupport iOS | supported | 支持订阅 BLE 特征值变化
|
|
5931
6625
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -5986,6 +6680,8 @@ export declare interface NotifyBLECharacteristicValueChangeParams {
|
|
|
5986
6680
|
* ```
|
|
5987
6681
|
* @since 0.0.27
|
|
5988
6682
|
* @contractStatus verified | 加速度事件的字段类型与必返性已与 Android、iOS 当前实现对齐
|
|
6683
|
+
* @containerSupport Page | supported
|
|
6684
|
+
* @containerSupport Widget | unsupported
|
|
5989
6685
|
* @platformSupport Android | supported | 支持监听加速度数据变化
|
|
5990
6686
|
* @platformSupport iOS | supported | 支持监听加速度数据变化
|
|
5991
6687
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6025,6 +6721,8 @@ export declare const onAccelerometerChange: ClientEventRegistry<AccelerometerCha
|
|
|
6025
6721
|
* ```
|
|
6026
6722
|
* @since 0.0.25
|
|
6027
6723
|
* @contractStatus verified | 省电模式变化事件的 isLowPowerModeEnabled 字段类型与必返性已与 Android、iOS 当前实现对齐
|
|
6724
|
+
* @containerSupport Page | supported
|
|
6725
|
+
* @containerSupport Widget | unsupported
|
|
6028
6726
|
* @platformSupport Android | supported | 支持监听省电模式变化
|
|
6029
6727
|
* @platformSupport iOS | supported | 支持监听省电模式变化
|
|
6030
6728
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6065,6 +6763,8 @@ export declare const onBatteryInfoChange: ClientEventRegistry<BatteryInfoChangeE
|
|
|
6065
6763
|
*
|
|
6066
6764
|
* @since 0.0.36
|
|
6067
6765
|
* @contractStatus verified | BLE 特征值变化事件的结构已与 Android、iOS 当前实现对齐;value 由框架统一解码为 ArrayBuffer
|
|
6766
|
+
* @containerSupport Page | supported
|
|
6767
|
+
* @containerSupport Widget | unsupported
|
|
6068
6768
|
* @platformSupport Android | supported | 支持监听 BLE 特征值变化
|
|
6069
6769
|
* @platformSupport iOS | supported | 支持监听 BLE 特征值变化
|
|
6070
6770
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6105,6 +6805,8 @@ export declare function onBLECharacteristicValueChange(callback: BLECharacterist
|
|
|
6105
6805
|
*
|
|
6106
6806
|
* @since 0.0.36
|
|
6107
6807
|
* @contractStatus verified | BLE 连接状态变化事件的结构已与 Android、iOS 当前实现对齐
|
|
6808
|
+
* @containerSupport Page | supported
|
|
6809
|
+
* @containerSupport Widget | unsupported
|
|
6108
6810
|
* @platformSupport Android | supported | 支持监听 BLE 连接状态变化
|
|
6109
6811
|
* @platformSupport iOS | supported | 支持监听 BLE 连接状态变化
|
|
6110
6812
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6144,6 +6846,8 @@ export declare const onBLEConnectionStateChange: ClientEventRegistry<BLEConnecti
|
|
|
6144
6846
|
*
|
|
6145
6847
|
* @since 0.0.36
|
|
6146
6848
|
* @contractStatus verified | 蓝牙适配器状态变化事件的结构已与 Android、iOS 当前实现对齐
|
|
6849
|
+
* @containerSupport Page | supported
|
|
6850
|
+
* @containerSupport Widget | unsupported
|
|
6147
6851
|
* @platformSupport Android | supported | 支持监听蓝牙适配器状态变化
|
|
6148
6852
|
* @platformSupport iOS | supported | 支持监听蓝牙适配器状态变化
|
|
6149
6853
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6183,6 +6887,8 @@ export declare const onBluetoothAdapterStateChange: ClientEventRegistry<GetBluet
|
|
|
6183
6887
|
*
|
|
6184
6888
|
* @since 0.0.36
|
|
6185
6889
|
* @contractStatus verified | 发现蓝牙设备事件的结构已与 Android、iOS 当前实现对齐;广播二进制字段由框架统一解码为 ArrayBuffer
|
|
6890
|
+
* @containerSupport Page | supported
|
|
6891
|
+
* @containerSupport Widget | unsupported
|
|
6186
6892
|
* @platformSupport Android | supported | 支持监听发现蓝牙设备
|
|
6187
6893
|
* @platformSupport iOS | supported | 支持监听发现蓝牙设备
|
|
6188
6894
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6210,6 +6916,45 @@ export declare const onBluetoothAdapterStateChange: ClientEventRegistry<GetBluet
|
|
|
6210
6916
|
*/
|
|
6211
6917
|
export declare function onBluetoothDeviceFound(callback: BluetoothDeviceFoundListener): () => void;
|
|
6212
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
|
+
|
|
6213
6958
|
/**
|
|
6214
6959
|
* 监听罗盘数据变化事件。
|
|
6215
6960
|
*
|
|
@@ -6227,6 +6972,8 @@ export declare function onBluetoothDeviceFound(callback: BluetoothDeviceFoundLis
|
|
|
6227
6972
|
* ```
|
|
6228
6973
|
* @since 0.0.26
|
|
6229
6974
|
* @contractStatus verified | 罗盘事件的 direction 字段类型与必返性已与 Android、iOS 当前实现对齐
|
|
6975
|
+
* @containerSupport Page | supported
|
|
6976
|
+
* @containerSupport Widget | unsupported
|
|
6230
6977
|
* @platformSupport Android | supported | 支持监听罗盘数据变化
|
|
6231
6978
|
* @platformSupport iOS | supported | 支持监听罗盘数据变化
|
|
6232
6979
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6263,6 +7010,8 @@ export declare const onCompassChange: ClientEventRegistry<CompassChangeEvent>;
|
|
|
6263
7010
|
* ```
|
|
6264
7011
|
* @since 0.0.29
|
|
6265
7012
|
* @contractStatus verified | 设备方向事件的字段类型与必返性已与 Android、iOS 当前实现对齐
|
|
7013
|
+
* @containerSupport Page | supported
|
|
7014
|
+
* @containerSupport Widget | unsupported
|
|
6266
7015
|
* @platformSupport Android | supported | 支持监听设备方向变化
|
|
6267
7016
|
* @platformSupport iOS | supported | 支持监听设备方向变化
|
|
6268
7017
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6301,6 +7050,8 @@ export declare const onDeviceMotionChange: ClientEventRegistry<DeviceMotionChang
|
|
|
6301
7050
|
* ```
|
|
6302
7051
|
* @since 0.0.27
|
|
6303
7052
|
* @contractStatus verified | 陀螺仪事件的字段类型与必返性已与 Android、iOS 当前实现对齐
|
|
7053
|
+
* @containerSupport Page | supported
|
|
7054
|
+
* @containerSupport Widget | unsupported
|
|
6304
7055
|
* @platformSupport Android | supported | 支持监听陀螺仪数据变化
|
|
6305
7056
|
* @platformSupport iOS | supported | 支持监听陀螺仪数据变化
|
|
6306
7057
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6338,6 +7089,8 @@ export declare const onGyroscopeChange: ClientEventRegistry<GyroscopeChangeEvent
|
|
|
6338
7089
|
* @since 0.0.20
|
|
6339
7090
|
* @contractStatus verified | 回调字段与 Android、iOS 事件一致;高度单位存在平台差异,已在平台差异中说明。
|
|
6340
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
|
|
6341
7094
|
* @platformSupport Android | supported | 支持监听键盘高度变化。
|
|
6342
7095
|
* @platformSupport iOS | supported | 支持监听键盘高度变化。
|
|
6343
7096
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -6377,6 +7130,8 @@ export declare const onKeyboardHeightChange: ClientEventRegistry<KeyboardHeightC
|
|
|
6377
7130
|
* @since 0.0.32
|
|
6378
7131
|
* @contractStatus verified | 豆包 Android、iOS 成功事件均会返回必需的 latitude 和 longitude,其他字段可由公开可选类型承载
|
|
6379
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
|
|
6380
7135
|
* @platformSupport Android | supported | 支持监听位置变化事件
|
|
6381
7136
|
* @platformSupport iOS | supported | 支持监听位置变化事件
|
|
6382
7137
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6425,6 +7180,8 @@ export declare function onLocationChange(callback: LocationChangeListener): () =
|
|
|
6425
7180
|
* @since 0.0.32
|
|
6426
7181
|
* @contractStatus verified | 错误信息必返、错误码可选的公开类型可准确表达双端事件
|
|
6427
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
|
|
6428
7185
|
* @platformSupport Android | supported | 支持监听位置更新异常事件
|
|
6429
7186
|
* @platformSupport iOS | supported | 支持监听位置更新异常事件
|
|
6430
7187
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6476,6 +7233,8 @@ export declare function onLocationChangeError(callback: LocationChangeErrorListe
|
|
|
6476
7233
|
*
|
|
6477
7234
|
* @since 0.0.26
|
|
6478
7235
|
* @contractStatus verified | 网络状态事件的 isConnected、networkType 字段类型与必返性已与 Android、iOS 当前实现对齐
|
|
7236
|
+
* @containerSupport Page | supported
|
|
7237
|
+
* @containerSupport Widget | unsupported
|
|
6479
7238
|
* @platformSupport Android | supported | 支持监听网络状态变化
|
|
6480
7239
|
* @platformSupport iOS | supported | 支持监听网络状态变化
|
|
6481
7240
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6499,7 +7258,7 @@ export declare const onNetworkStatusChange: ClientEventRegistry<NetworkStatusCha
|
|
|
6499
7258
|
/**
|
|
6500
7259
|
* 监听应用主题变化。
|
|
6501
7260
|
*
|
|
6502
|
-
*
|
|
7261
|
+
* 当用户在系统设置或豆包客户端内切换浅色、深色主题时触发。回调参数中的 `theme` 表示切换后的主题,可与
|
|
6503
7262
|
* {@link getAppBaseInfo} 返回的 `theme` 字段配合使用。
|
|
6504
7263
|
*
|
|
6505
7264
|
* @summary 监听应用主题变化。
|
|
@@ -6517,7 +7276,9 @@ export declare const onNetworkStatusChange: ClientEventRegistry<NetworkStatusCha
|
|
|
6517
7276
|
*
|
|
6518
7277
|
* @since 0.0.32
|
|
6519
7278
|
* @contractStatus verified | 主题变化事件回调只包含必需的 theme 字段,与公开类型一致。
|
|
6520
|
-
* @contractMismatch non-blocking | behavior | onThemeChange | Android | 用户切换浅色、深色主题时触发回调 | iOS 由客户端主动派发事件,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
|
|
6521
7282
|
* @platformSupport Android | supported | 支持注册主题变化监听。
|
|
6522
7283
|
* @platformSupport iOS | supported | 支持注册主题变化监听。
|
|
6523
7284
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -6532,7 +7293,7 @@ export declare const onNetworkStatusChange: ClientEventRegistry<NetworkStatusCha
|
|
|
6532
7293
|
* }
|
|
6533
7294
|
* ```
|
|
6534
7295
|
* @errorCode none | - | - | Android,iOS | 该监听只接收成功的主题变化事件 | 无需处理
|
|
6535
|
-
* @platformNote Android |
|
|
7296
|
+
* @platformNote Android | 主题变化事件依赖豆包客户端接入主题通知,未接入时可能不触发
|
|
6536
7297
|
*
|
|
6537
7298
|
* @public
|
|
6538
7299
|
*/
|
|
@@ -6557,6 +7318,8 @@ export declare function onThemeChange(callback: ThemeChangeListener): () => void
|
|
|
6557
7318
|
* @since 0.0.26
|
|
6558
7319
|
* @contractStatus verified | 用户截屏事件的空参数结构已与 Android、iOS 当前实现对齐;双端检测机制不同但公开类型已准确表达
|
|
6559
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
|
|
6560
7323
|
* @platformSupport Android | supported | 支持监听用户截屏
|
|
6561
7324
|
* @platformSupport iOS | supported | 支持监听用户截屏
|
|
6562
7325
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6593,6 +7356,8 @@ export declare const onUserCaptureScreen: ClientEventRegistry<UserCaptureScreenE
|
|
|
6593
7356
|
* @since 0.0.37
|
|
6594
7357
|
* @contractStatus verified | 录屏事件的 state 字段类型与必返性已与 Android、iOS 当前实现对齐;双端支持范围不同但公开类型已准确表达
|
|
6595
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
|
|
6596
7361
|
* @platformSupport Android | supported | 支持监听用户录屏(Android 15 及以上)
|
|
6597
7362
|
* @platformSupport iOS | supported | 支持监听用户录屏
|
|
6598
7363
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6631,6 +7396,8 @@ export declare const onUserScreenRecord: ClientEventRegistry<UserScreenRecordEve
|
|
|
6631
7396
|
*
|
|
6632
7397
|
* @since 0.0.31
|
|
6633
7398
|
* @contractStatus verified | 双端均可监听 Wi-Fi 连接事件
|
|
7399
|
+
* @containerSupport Page | supported
|
|
7400
|
+
* @containerSupport Widget | unsupported
|
|
6634
7401
|
* @platformSupport Android | supported | 支持监听 Wi-Fi 连接事件
|
|
6635
7402
|
* @platformSupport iOS | supported | 支持监听 Wi-Fi 连接事件
|
|
6636
7403
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6668,6 +7435,8 @@ export declare const onWifiConnected: ClientEventRegistry<WifiConnectedEvent>;
|
|
|
6668
7435
|
* @returns 不包含字段的结果对象。
|
|
6669
7436
|
* @since 0.0.25
|
|
6670
7437
|
* @contractStatus verified | 打开蓝牙适配器的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
7438
|
+
* @containerSupport Page | supported
|
|
7439
|
+
* @containerSupport Widget | unsupported
|
|
6671
7440
|
* @platformSupport Android | supported | 支持打开蓝牙适配器
|
|
6672
7441
|
* @platformSupport iOS | supported | 支持打开蓝牙适配器
|
|
6673
7442
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -6763,6 +7532,63 @@ export declare interface OpenLocationParams {
|
|
|
6763
7532
|
latitude: number;
|
|
6764
7533
|
}
|
|
6765
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
|
+
* 页面栈操作。
|
|
7581
|
+
*
|
|
7582
|
+
* - `push`:始终压入新的页面实例。
|
|
7583
|
+
* - `replace`:目标为栈顶页面时更新栈顶页面,否则替换栈顶页面。
|
|
7584
|
+
* - `navigate`:目标已在栈中时回退到最近的目标页面并更新,否则压入新页面。
|
|
7585
|
+
* - `pop_to`:目标已在栈中时回退到最近的目标页面并更新,否则替换栈顶页面。
|
|
7586
|
+
*
|
|
7587
|
+
* @default 'push'
|
|
7588
|
+
*/
|
|
7589
|
+
mode?: OpenPageMode;
|
|
7590
|
+
}
|
|
7591
|
+
|
|
6766
7592
|
/**
|
|
6767
7593
|
* 打开智能服务授权设置页面
|
|
6768
7594
|
*
|
|
@@ -6771,7 +7597,7 @@ export declare interface OpenLocationParams {
|
|
|
6771
7597
|
* @returns Promise 对象,设置页关闭后返回最新授权设置
|
|
6772
7598
|
* @remarks
|
|
6773
7599
|
* 该接口不要求在用户点击事件中调用。
|
|
6774
|
-
*
|
|
7600
|
+
* JavaScript 调用方也不要传入 `withSubscriptions: true`,否则豆包会返回 `subscription templates are not supported yet`。
|
|
6775
7601
|
* @example
|
|
6776
7602
|
* ```typescript
|
|
6777
7603
|
* import { openSetting } from '@doubao-dev/framework/api';
|
|
@@ -6786,12 +7612,15 @@ export declare interface OpenLocationParams {
|
|
|
6786
7612
|
*
|
|
6787
7613
|
* @since 0.0.39
|
|
6788
7614
|
* @contractStatus verified | withSubscriptions 当前仅允许 false,Android、iOS 均支持打开设置页并返回授权设置。
|
|
7615
|
+
* @containerSupport Page | supported
|
|
7616
|
+
* @containerSupport Widget | supported
|
|
6789
7617
|
* @platformSupport Android | supported | 支持打开授权设置页并在关闭后返回最新授权设置。
|
|
6790
7618
|
* @platformSupport iOS | supported | 支持打开授权设置页并在关闭后返回最新授权设置。
|
|
6791
7619
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
6792
7620
|
* @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
|
|
6793
7621
|
* @permission none | - | none | Android,iOS | 无需额外权限
|
|
6794
7622
|
* @precondition All | 无额外前置条件,不要求在用户点击事件中调用。
|
|
7623
|
+
* @usageNote All | 设置页只能修改当前智能服务的 scope,不承载 HealthKit 系统权限设置。
|
|
6795
7624
|
* @usageNote All | 豆包当前不支持订阅模板,不要传入 withSubscriptions: true。
|
|
6796
7625
|
* @resultExample
|
|
6797
7626
|
* ```json
|
|
@@ -6823,10 +7652,104 @@ export declare interface OpenSettingOptions {
|
|
|
6823
7652
|
export declare interface OpenSettingResult {
|
|
6824
7653
|
/** 用户授权结果,key 为权限 scope,value 表示是否已授权 */
|
|
6825
7654
|
authSetting: AuthSetting;
|
|
6826
|
-
/**
|
|
7655
|
+
/** 预留的订阅消息设置字段。豆包当前仅支持 `withSubscriptions: false`,因此不会返回该字段。 */
|
|
6827
7656
|
subscriptionsSetting?: SubscriptionsSetting;
|
|
6828
7657
|
}
|
|
6829
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
|
+
|
|
6830
7753
|
/**
|
|
6831
7754
|
* 插件账号信息(仅在插件中调用时包含)。
|
|
6832
7755
|
*
|
|
@@ -6870,6 +7793,8 @@ export declare interface PluginAccountInfo {
|
|
|
6870
7793
|
* @contractStatus conflict | result 为 false 时双端回传行为不一致,且 result 为 true 时 code 实为必填。
|
|
6871
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 时的双端回传结果语义
|
|
6872
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
|
|
6873
7798
|
* @platformSupport Android | supported | 支持向豆包回传 MCP 授权登录结果。
|
|
6874
7799
|
* @platformSupport iOS | supported | 支持向豆包回传 MCP 授权登录结果。
|
|
6875
7800
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -6938,6 +7863,8 @@ export declare interface PostLoginResultRequest {
|
|
|
6938
7863
|
* @contractStatus conflict | current 的数字下标形式和 referrerPolicy 在 Android、iOS 当前实现中不生效
|
|
6939
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 | 让双端支持数字下标,或从公开类型中移除数字形式
|
|
6940
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
|
|
6941
7868
|
* @platformSupport Android | supported | 支持预览网络图片和豆包智能服务本地图片
|
|
6942
7869
|
* @platformSupport iOS | supported | 支持预览网络图片和豆包智能服务本地图片
|
|
6943
7870
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -7037,6 +7964,8 @@ export declare interface PrivacySettingResult {
|
|
|
7037
7964
|
* @returns 不包含字段的结果对象。
|
|
7038
7965
|
* @since 0.0.25
|
|
7039
7966
|
* @contractStatus verified | 读取特征值的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
7967
|
+
* @containerSupport Page | supported
|
|
7968
|
+
* @containerSupport Widget | unsupported
|
|
7040
7969
|
* @platformSupport Android | supported | 支持读取 BLE 特征值
|
|
7041
7970
|
* @platformSupport iOS | supported | 支持读取 BLE 特征值
|
|
7042
7971
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -7298,6 +8227,8 @@ export declare type RecorderSampleRate = 8000 | 11025 | 12000 | 16000 | 22050 |
|
|
|
7298
8227
|
*
|
|
7299
8228
|
* @since 0.0.19
|
|
7300
8229
|
* @contractStatus verified | 公开参数、跳转语义及 Android、iOS 失败字段已核对一致。
|
|
8230
|
+
* @containerSupport Page | supported
|
|
8231
|
+
* @containerSupport Widget | unsupported
|
|
7301
8232
|
* @platformSupport Android | supported | 支持关闭当前页面并跳转到指定页面。
|
|
7302
8233
|
* @platformSupport iOS | supported | 支持关闭当前页面并跳转到指定页面。
|
|
7303
8234
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -7333,6 +8264,8 @@ export declare const redirectTo: (params: NavigateToParams) => Promise<object>;
|
|
|
7333
8264
|
*
|
|
7334
8265
|
* @since 0.0.19
|
|
7335
8266
|
* @contractStatus verified | 公开参数、跳转语义及 Android、iOS 失败字段已核对一致。
|
|
8267
|
+
* @containerSupport Page | supported
|
|
8268
|
+
* @containerSupport Widget | unsupported
|
|
7336
8269
|
* @platformSupport Android | supported | 支持关闭所有页面并跳转到指定页面。
|
|
7337
8270
|
* @platformSupport iOS | supported | 支持关闭所有页面并跳转到指定页面。
|
|
7338
8271
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -7414,6 +8347,8 @@ export declare interface RemoveSavedFileParams {
|
|
|
7414
8347
|
*
|
|
7415
8348
|
* @since 0.0.17
|
|
7416
8349
|
* @contractStatus verified | 公开参数、删除语义及 Android、iOS 错误字段已核对一致。
|
|
8350
|
+
* @containerSupport Page | supported
|
|
8351
|
+
* @containerSupport Widget | supported
|
|
7417
8352
|
* @platformSupport Android | supported | 支持按智能服务维度删除指定 key。
|
|
7418
8353
|
* @platformSupport iOS | supported | 支持按智能服务维度删除指定 key。
|
|
7419
8354
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -7456,6 +8391,8 @@ export declare interface RemoveStorageParams {
|
|
|
7456
8391
|
*
|
|
7457
8392
|
* @since 0.0.19
|
|
7458
8393
|
* @contractStatus verified | 公开参数、删除语义及 Android、iOS 错误字段已核对一致。
|
|
8394
|
+
* @containerSupport Page | supported
|
|
8395
|
+
* @containerSupport Widget | supported
|
|
7459
8396
|
* @platformSupport Android | supported | 支持按智能服务维度同步删除指定 key。
|
|
7460
8397
|
* @platformSupport iOS | supported | 支持按智能服务维度同步删除指定 key。
|
|
7461
8398
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -7518,6 +8455,8 @@ export declare interface RenameParams {
|
|
|
7518
8455
|
*
|
|
7519
8456
|
* @since 0.0.28
|
|
7520
8457
|
* @contractStatus verified | 事件名与事件参数会被 Android、iOS 一并上报,公开参数与双端消费一致。
|
|
8458
|
+
* @containerSupport Page | supported
|
|
8459
|
+
* @containerSupport Widget | supported
|
|
7521
8460
|
* @platformSupport Android | supported | 支持上报智能服务数据分析事件。
|
|
7522
8461
|
* @platformSupport iOS | supported | 支持上报智能服务数据分析事件。
|
|
7523
8462
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -7572,6 +8511,8 @@ export declare interface ReportEventParams {
|
|
|
7572
8511
|
* @contractStatus conflict | method 支持范围与 arraybuffer 返回类型在 Android、iOS 均与公开类型不一致
|
|
7573
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 | 收窄公开类型声明,或在文档明确各端实际支持范围
|
|
7574
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
|
|
7575
8516
|
* @platformSupport Android | supported | 支持发起 HTTP/HTTPS 网络请求,method 支持 GET/POST/PUT/DELETE。
|
|
7576
8517
|
* @platformSupport iOS | supported | 支持发起 HTTP/HTTPS 网络请求,method 仅支持 GET/POST。
|
|
7577
8518
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -7643,6 +8584,8 @@ export declare type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' |
|
|
|
7643
8584
|
*
|
|
7644
8585
|
* @since 0.0.28
|
|
7645
8586
|
* @contractStatus verified | 成功返回结构与 Android、iOS 一致;失败通过 Promise reject,业务错误在错误对象的 data 字段。
|
|
8587
|
+
* @containerSupport Page | supported
|
|
8588
|
+
* @containerSupport Widget | supported
|
|
7646
8589
|
* @platformSupport Android | supported | 支持发起订单支付流程并返回 orderId。
|
|
7647
8590
|
* @platformSupport iOS | supported | 支持发起订单支付流程并返回 orderId。
|
|
7648
8591
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -7829,6 +8772,8 @@ export declare interface SaveFileResult {
|
|
|
7829
8772
|
* ```
|
|
7830
8773
|
* @since 0.0.26
|
|
7831
8774
|
* @contractStatus verified | Android、iOS 均可将有效本地图片写入系统相册
|
|
8775
|
+
* @containerSupport Page | supported
|
|
8776
|
+
* @containerSupport Widget | unsupported
|
|
7832
8777
|
* @platformSupport Android | supported | 支持将本地图片保存到系统相册
|
|
7833
8778
|
* @platformSupport iOS | supported | 支持将本地图片保存到系统相册
|
|
7834
8779
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -7876,6 +8821,8 @@ export declare interface SaveImageToPhotosAlbumParams {
|
|
|
7876
8821
|
* @contractStatus conflict | onlyFromCamera/scanType 参数的生效情况及取消行为双端不一致
|
|
7877
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 | 统一双端扫码类型过滤能力
|
|
7878
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
|
|
7879
8826
|
* @platformSupport Android | supported | 支持调起扫码
|
|
7880
8827
|
* @platformSupport iOS | supported | 支持调起扫码
|
|
7881
8828
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -7963,7 +8910,7 @@ export declare type ScanCodeType = 'barCode' | 'qrCode' | 'datamatrix' | 'pdf417
|
|
|
7963
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';
|
|
7964
8911
|
|
|
7965
8912
|
/** @public */
|
|
7966
|
-
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';
|
|
7967
8914
|
|
|
7968
8915
|
/**
|
|
7969
8916
|
* 选择消息文件后返回的文件类型。
|
|
@@ -8008,6 +8955,8 @@ export declare type SelectedMessageFileType = 'video' | 'image' | 'file';
|
|
|
8008
8955
|
*
|
|
8009
8956
|
* @since 0.0.37
|
|
8010
8957
|
* @contractStatus verified | 公开参数与 Android、iOS 的消息提交行为一致。
|
|
8958
|
+
* @containerSupport Page | supported
|
|
8959
|
+
* @containerSupport Widget | supported
|
|
8011
8960
|
* @platformSupport Android | supported | 支持在卡片或智能服务页面中发送后续消息。
|
|
8012
8961
|
* @platformSupport iOS | supported | 支持在卡片和智能服务页面中发送后续消息。
|
|
8013
8962
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -8095,6 +9044,8 @@ export declare interface SendQueryMessageParams {
|
|
|
8095
9044
|
* @since 0.0.25
|
|
8096
9045
|
* @contractStatus conflict | 拉起短信面板的成功语义双端不一致
|
|
8097
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
|
|
8098
9049
|
* @platformSupport Android | supported | 支持拉起系统短信面板
|
|
8099
9050
|
* @platformSupport iOS | supported | 支持拉起系统短信面板
|
|
8100
9051
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -8224,6 +9175,8 @@ export declare interface SetAdditionalContextParams {
|
|
|
8224
9175
|
* @since 0.0.25
|
|
8225
9176
|
* @contractStatus conflict | 豆包 iOS 未提供设置 MTU 能力,仅 Android 可调用
|
|
8226
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
|
|
8227
9180
|
* @platformSupport Android | supported | 支持设置 BLE MTU
|
|
8228
9181
|
* @platformSupport iOS | unsupported | 豆包 iOS 未实现设置 MTU,调用返回不支持
|
|
8229
9182
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -8282,6 +9235,8 @@ export declare interface SetBLEMTUResult {
|
|
|
8282
9235
|
* @returns 不包含字段的结果对象。
|
|
8283
9236
|
* @since 0.0.20
|
|
8284
9237
|
* @contractStatus verified | 设置剪贴板的成功语义已与 Android、iOS 当前实现对齐
|
|
9238
|
+
* @containerSupport Page | supported
|
|
9239
|
+
* @containerSupport Widget | supported
|
|
8285
9240
|
* @platformSupport Android | supported | 支持写入剪贴板
|
|
8286
9241
|
* @platformSupport iOS | supported | 支持写入剪贴板
|
|
8287
9242
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -8329,6 +9284,8 @@ export declare interface SetClipboardDataParams {
|
|
|
8329
9284
|
* @since 0.0.25
|
|
8330
9285
|
* @contractStatus verified | 设置屏幕常亮的成功语义已与 Android、iOS 当前实现对齐;双端实现机制不同但公开类型已准确表达
|
|
8331
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
|
|
8332
9289
|
* @platformSupport Android | supported | 支持设置屏幕常亮
|
|
8333
9290
|
* @platformSupport iOS | supported | 支持设置屏幕常亮
|
|
8334
9291
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -8375,6 +9332,8 @@ export declare interface SetKeepScreenOnParams {
|
|
|
8375
9332
|
*
|
|
8376
9333
|
* @since 0.0.17
|
|
8377
9334
|
* @contractStatus verified | 公开参数、写入语义及 Android、iOS 错误字段已核对一致。
|
|
9335
|
+
* @containerSupport Page | supported
|
|
9336
|
+
* @containerSupport Widget | supported
|
|
8378
9337
|
* @platformSupport Android | supported | 支持按智能服务维度写入本地缓存。
|
|
8379
9338
|
* @platformSupport iOS | supported | 支持按智能服务维度写入本地缓存。
|
|
8380
9339
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -8424,6 +9383,8 @@ export declare interface SetStorageParams<TData = unknown> {
|
|
|
8424
9383
|
*
|
|
8425
9384
|
* @since 0.0.19
|
|
8426
9385
|
* @contractStatus verified | 公开参数、写入语义及 Android、iOS 错误字段已核对一致。
|
|
9386
|
+
* @containerSupport Page | supported
|
|
9387
|
+
* @containerSupport Widget | supported
|
|
8427
9388
|
* @platformSupport Android | supported | 支持按智能服务维度同步写入本地缓存。
|
|
8428
9389
|
* @platformSupport iOS | supported | 支持按智能服务维度同步写入本地缓存。
|
|
8429
9390
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -8467,6 +9428,8 @@ export declare function setStorageSync<TData = unknown>(params: SetStorageParams
|
|
|
8467
9428
|
* @since 0.0.25
|
|
8468
9429
|
* @contractStatus conflict | 豆包 Android 未提供设置预设列表能力,仅 iOS 可调用
|
|
8469
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
|
|
8470
9433
|
* @platformSupport Android | unsupported | 豆包 Android 未实现设置预设列表,调用固定失败
|
|
8471
9434
|
* @platformSupport iOS | supported | 支持设置 Wi-Fi 预设列表
|
|
8472
9435
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -8520,6 +9483,8 @@ export declare interface SetWifiListParams {
|
|
|
8520
9483
|
*
|
|
8521
9484
|
* @since 0.0.26
|
|
8522
9485
|
* @contractStatus verified | 公开参数、返回 tapIndex 及 Android、iOS 行为已核对一致。
|
|
9486
|
+
* @containerSupport Page | supported
|
|
9487
|
+
* @containerSupport Widget | supported
|
|
8523
9488
|
* @platformSupport Android | supported | 支持展示操作菜单。
|
|
8524
9489
|
* @platformSupport iOS | supported | 支持展示操作菜单。
|
|
8525
9490
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -8609,6 +9574,8 @@ export declare interface ShowActionSheetResult {
|
|
|
8609
9574
|
* @since 0.0.36
|
|
8610
9575
|
* @contractStatus conflict | 参数校验错误码双端一致,但 provider 不可用与三按钮场景的错误处理在 Android、iOS 上不一致。
|
|
8611
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
|
|
8612
9579
|
* @platformSupport Android | supported | 支持展示 Native 底部弹窗。
|
|
8613
9580
|
* @platformSupport iOS | supported | 支持展示 Native 底部弹窗。
|
|
8614
9581
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -8680,6 +9647,8 @@ export declare type ShowBottomSheetResult = BottomSheetButtonClickResult | Botto
|
|
|
8680
9647
|
*
|
|
8681
9648
|
* @since 0.0.26
|
|
8682
9649
|
* @contractStatus verified | 无参数、无返回字段,与 Android、iOS 实现一致。
|
|
9650
|
+
* @containerSupport Page | supported
|
|
9651
|
+
* @containerSupport Widget | unsupported
|
|
8683
9652
|
* @platformSupport Android | supported | 支持展示 loading 提示框。
|
|
8684
9653
|
* @platformSupport iOS | supported | 支持展示 loading 提示框。
|
|
8685
9654
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -8721,15 +9690,16 @@ export declare interface ShowLoadingParams {
|
|
|
8721
9690
|
* ```
|
|
8722
9691
|
*
|
|
8723
9692
|
* @since 0.0.26
|
|
8724
|
-
* @contractStatus verified |
|
|
8725
|
-
* @
|
|
9693
|
+
* @contractStatus verified | 参数、返回 action/content 及 Android、iOS 行为已核对一致;HarmonyOS 当前不提供实现。
|
|
9694
|
+
* @containerSupport Page | supported
|
|
9695
|
+
* @containerSupport Widget | supported
|
|
8726
9696
|
* @platformSupport Android | supported | 支持展示模态对话框。
|
|
8727
9697
|
* @platformSupport iOS | supported | 支持展示模态对话框。
|
|
8728
9698
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
8729
9699
|
* @platformSupport HarmonyOS | unsupported | 当前未提供该平台实现。
|
|
8730
9700
|
* @permission none | - | none | Android,iOS | 无需额外权限
|
|
8731
9701
|
* @precondition All | 无额外前置条件
|
|
8732
|
-
* @usageNote All |
|
|
9702
|
+
* @usageNote All | 仅当 showCancel 为 true 时展示取消按钮;仅当 tapMaskToDismiss 为 true 时点击蒙层可关闭;editable 为 true 且用户确认时返回输入 content。
|
|
8733
9703
|
* @resultExample
|
|
8734
9704
|
* ```json
|
|
8735
9705
|
* {
|
|
@@ -8740,7 +9710,7 @@ export declare interface ShowLoadingParams {
|
|
|
8740
9710
|
*
|
|
8741
9711
|
* @public
|
|
8742
9712
|
*/
|
|
8743
|
-
export declare const showModal: (params
|
|
9713
|
+
export declare const showModal: (params?: ShowModalParams | undefined) => Promise<ShowModalResult>;
|
|
8744
9714
|
|
|
8745
9715
|
/**
|
|
8746
9716
|
* 显示模态对话框的参数。
|
|
@@ -8753,25 +9723,50 @@ export declare interface ShowModalParams {
|
|
|
8753
9723
|
* @default -
|
|
8754
9724
|
*/
|
|
8755
9725
|
title?: string;
|
|
8756
|
-
/**
|
|
8757
|
-
|
|
9726
|
+
/**
|
|
9727
|
+
* 模态对话框的内容。
|
|
9728
|
+
* @default -
|
|
9729
|
+
*/
|
|
9730
|
+
content?: string;
|
|
8758
9731
|
/**
|
|
8759
9732
|
* 是否显示取消按钮。
|
|
8760
9733
|
* @default true
|
|
8761
9734
|
*/
|
|
8762
9735
|
showCancel?: boolean;
|
|
8763
9736
|
/**
|
|
8764
|
-
*
|
|
8765
|
-
* @default
|
|
8766
|
-
* @constraint
|
|
9737
|
+
* 取消按钮的文字。
|
|
9738
|
+
* @default 取消
|
|
9739
|
+
* @constraint 最多 4 个字符。
|
|
8767
9740
|
*/
|
|
8768
9741
|
cancelText?: string;
|
|
8769
9742
|
/**
|
|
8770
|
-
*
|
|
8771
|
-
* @default
|
|
8772
|
-
* @constraint
|
|
9743
|
+
* 取消按钮的文字颜色。
|
|
9744
|
+
* @default #000000
|
|
9745
|
+
* @constraint 必须是 16 进制格式的颜色字符串。
|
|
9746
|
+
*/
|
|
9747
|
+
cancelColor?: string;
|
|
9748
|
+
/**
|
|
9749
|
+
* 确认按钮的文字。
|
|
9750
|
+
* @default 确定
|
|
9751
|
+
* @constraint 最多 4 个字符。
|
|
8773
9752
|
*/
|
|
8774
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;
|
|
8775
9770
|
/**
|
|
8776
9771
|
* 是否允许点击蒙层关闭对话框。
|
|
8777
9772
|
* @default true
|
|
@@ -8787,22 +9782,17 @@ export declare interface ShowModalParams {
|
|
|
8787
9782
|
export declare interface ShowModalResult {
|
|
8788
9783
|
/** 用户点击的动作。 */
|
|
8789
9784
|
action: 'confirm' | 'cancel' | 'mask';
|
|
9785
|
+
/** `editable` 为 true 时,用户点击确认后输入的文本。 */
|
|
9786
|
+
content?: string;
|
|
8790
9787
|
}
|
|
8791
9788
|
|
|
8792
9789
|
/**
|
|
8793
9790
|
* 显示 Toast 提示。
|
|
8794
9791
|
*
|
|
8795
|
-
* 参数 `options` 包含以下字段:
|
|
8796
|
-
* - `message`:提示的内容。
|
|
8797
|
-
* - `type`:Toast 的类型,可选值为 'default'、'success'、'error' 或 'warning'。
|
|
8798
|
-
* - `duration`:提示的延迟时间,单位毫秒,默认为 2000。
|
|
8799
|
-
* - `icon`:图标,可选值为 'success'、'error'、'warn'。
|
|
8800
|
-
* - `customIcon`:自定义图标的 URL 或 base64 字符串。
|
|
8801
|
-
*
|
|
8802
9792
|
* @summary 显示 Toast 提示。
|
|
8803
9793
|
* @returns 返回一个 Promise,在 Toast 显示结束时 resolve。
|
|
8804
9794
|
* @remarks
|
|
8805
|
-
*
|
|
9795
|
+
* Android 默认显示 3000 毫秒,iOS 默认显示 2000 毫秒;需要双端一致时请显式传入 `duration`。
|
|
8806
9796
|
* @example
|
|
8807
9797
|
* ```typescript
|
|
8808
9798
|
* import { showToast } from '@doubao-dev/framework/api';
|
|
@@ -8828,6 +9818,8 @@ export declare interface ShowModalResult {
|
|
|
8828
9818
|
* @since 0.0.9
|
|
8829
9819
|
* @contractStatus conflict | 公开参数 customIcon 在 Android、iOS 均未渲染,与其可自定义图标的定义冲突。
|
|
8830
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
|
|
8831
9823
|
* @platformSupport Android | supported | 支持展示 Toast 提示。
|
|
8832
9824
|
* @platformSupport iOS | supported | 支持展示 Toast 提示。
|
|
8833
9825
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -8849,7 +9841,7 @@ export declare interface ShowModalResult {
|
|
|
8849
9841
|
* @errorCode errNo | 104 | invalid parameter | Android,iOS | message 为空;iOS 还会在 icon 取值非法或入参无法解析时返回(type 由前端归一化为合法值,非法 type 场景不会触发) | 修正参数后重试。
|
|
8850
9842
|
* @errorCode errNo | 103 | feature not support | iOS | 豆包 UIService 未实现,无法展示 Toast | 降级到其他提示方式。
|
|
8851
9843
|
* @errorCode common | 102 | Android
|
|
8852
|
-
* @platformNote iOS | 参数校验失败统一返回 errNo 104;UIService 缺失时返回 errNo 103。Android 参数校验失败返回 errNo 104
|
|
9844
|
+
* @platformNote iOS | 参数校验失败统一返回 errNo 104;UIService 缺失时返回 errNo 103。Android 参数校验失败返回 errNo 104,豆包页面运行上下文缺失返回 errNo 102。
|
|
8853
9845
|
*
|
|
8854
9846
|
* @public
|
|
8855
9847
|
* */
|
|
@@ -8866,8 +9858,8 @@ export declare interface ShowToastParams {
|
|
|
8866
9858
|
type?: 'default' | 'success' | 'error' | 'warning';
|
|
8867
9859
|
/**
|
|
8868
9860
|
* 提示的持续时间,单位毫秒。
|
|
8869
|
-
* @default
|
|
8870
|
-
* @constraint
|
|
9861
|
+
* @default Android 3000,iOS 2000
|
|
9862
|
+
* @constraint 需双端保持一致时请显式传入。
|
|
8871
9863
|
*/
|
|
8872
9864
|
duration?: number;
|
|
8873
9865
|
/**
|
|
@@ -8888,7 +9880,7 @@ export declare interface ShowToastParams {
|
|
|
8888
9880
|
* @param params - `createSignOrder` 返回的平台签约订单号。
|
|
8889
9881
|
* @returns 签约页面流程正常返回时解析为空对象;该结果不代表签约成功。
|
|
8890
9882
|
* @remarks
|
|
8891
|
-
*
|
|
9883
|
+
* 如果用户尚未绑定抖音账号,豆包可能先拉起账号绑定流程,再继续展示签约页面。
|
|
8892
9884
|
*
|
|
8893
9885
|
* 用户的最终签约状态必须以业务服务端查询签约单详情或收到的签约结果回调为准。
|
|
8894
9886
|
* 业务服务端还需要维护业务用户与签约 ID 的对应关系。
|
|
@@ -8918,6 +9910,8 @@ export declare interface ShowToastParams {
|
|
|
8918
9910
|
* @since 0.0.28
|
|
8919
9911
|
* @contractStatus verified | 成功解析为空对象,与 Android、iOS 一致;失败通过 Promise reject,业务错误在错误对象的 data 字段。公开联合类型的失败分支不会作为 resolve 值出现,仅作后续对齐项。
|
|
8920
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
|
|
8921
9915
|
* @platformSupport Android | supported | 支持拉起签约流程。
|
|
8922
9916
|
* @platformSupport iOS | supported | 支持拉起签约流程。
|
|
8923
9917
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -8996,7 +9990,7 @@ export declare interface SocketTask {
|
|
|
8996
9990
|
/**
|
|
8997
9991
|
* 表示 Socket 正在连接。
|
|
8998
9992
|
*
|
|
8999
|
-
* `connectSocket`
|
|
9993
|
+
* `connectSocket` 刚返回且豆包客户端尚未完成握手时通常处于该状态。
|
|
9000
9994
|
*/
|
|
9001
9995
|
readonly CONNECTING: 0;
|
|
9002
9996
|
/**
|
|
@@ -9008,7 +10002,7 @@ export declare interface SocketTask {
|
|
|
9008
10002
|
/**
|
|
9009
10003
|
* 表示 Socket 连接关闭中。
|
|
9010
10004
|
*
|
|
9011
|
-
* 调用 {@link SocketTask.close}
|
|
10005
|
+
* 调用 {@link SocketTask.close} 后,等待豆包客户端完成关闭流程时通常处于该状态。
|
|
9012
10006
|
*/
|
|
9013
10007
|
readonly CLOSING: 2;
|
|
9014
10008
|
/**
|
|
@@ -9021,7 +10015,7 @@ export declare interface SocketTask {
|
|
|
9021
10015
|
* 当前 Socket 连接状态 code。
|
|
9022
10016
|
*
|
|
9023
10017
|
* 可与 `CONNECTING`、`OPEN`、`CLOSING`、`CLOSED` 常量比较。
|
|
9024
|
-
*
|
|
10018
|
+
* 如果因为参数错误等原因导致豆包客户端没有成功创建连接,则为 `undefined`。
|
|
9025
10019
|
*/
|
|
9026
10020
|
readonly readyState: number | undefined;
|
|
9027
10021
|
/**
|
|
@@ -9073,7 +10067,7 @@ export declare interface SocketTask {
|
|
|
9073
10067
|
/**
|
|
9074
10068
|
* WebSocket 关闭事件。
|
|
9075
10069
|
*
|
|
9076
|
-
*
|
|
10070
|
+
* 当前连接被主动关闭、服务端关闭或豆包客户端因异常回收连接时触发。
|
|
9077
10071
|
* 触发后 `readyState` 会变为 `SocketTask.CLOSED`,该 `SocketTask` 不应再继续发送数据。
|
|
9078
10072
|
*
|
|
9079
10073
|
* @public
|
|
@@ -9082,31 +10076,31 @@ export declare interface SocketTaskCloseEvent {
|
|
|
9082
10076
|
/**
|
|
9083
10077
|
* 关闭状态码。
|
|
9084
10078
|
*
|
|
9085
|
-
* 可能来自调用 {@link SocketTask.close} 时传入的 `code
|
|
10079
|
+
* 可能来自调用 {@link SocketTask.close} 时传入的 `code`,也可能来自服务端或豆包客户端。
|
|
9086
10080
|
*/
|
|
9087
10081
|
code?: number;
|
|
9088
10082
|
/**
|
|
9089
10083
|
* 关闭原因。
|
|
9090
10084
|
*
|
|
9091
|
-
* 可能来自调用 {@link SocketTask.close} 时传入的 `reason
|
|
10085
|
+
* 可能来自调用 {@link SocketTask.close} 时传入的 `reason`,也可能来自服务端或豆包客户端。
|
|
9092
10086
|
*/
|
|
9093
10087
|
reason?: string;
|
|
9094
10088
|
/**
|
|
9095
10089
|
* 错误信息。
|
|
9096
10090
|
*
|
|
9097
|
-
*
|
|
10091
|
+
* 非正常关闭时豆包客户端可能通过该字段补充失败原因;正常关闭时通常为空。
|
|
9098
10092
|
*/
|
|
9099
10093
|
errMsg?: string;
|
|
9100
10094
|
/**
|
|
9101
10095
|
* 当前连接使用的网络传输层协议。
|
|
9102
10096
|
*
|
|
9103
|
-
*
|
|
10097
|
+
* 该字段由豆包客户端返回,部分运行环境可能不提供。
|
|
9104
10098
|
*/
|
|
9105
10099
|
protocolType?: string;
|
|
9106
10100
|
/**
|
|
9107
|
-
*
|
|
10101
|
+
* 豆包客户端使用的 WebSocket 实现类型。
|
|
9108
10102
|
*
|
|
9109
|
-
*
|
|
10103
|
+
* 该字段由豆包客户端返回,部分运行环境可能不提供。
|
|
9110
10104
|
*/
|
|
9111
10105
|
socketType?: string;
|
|
9112
10106
|
}
|
|
@@ -9123,10 +10117,10 @@ export declare interface SocketTaskCloseParams {
|
|
|
9123
10117
|
/**
|
|
9124
10118
|
* 关闭连接状态码。
|
|
9125
10119
|
*
|
|
9126
|
-
*
|
|
10120
|
+
* 不传时由豆包客户端按正常关闭处理,通常等价于 `1000`。
|
|
9127
10121
|
* 常见值包括:
|
|
9128
10122
|
* - `1000`: 正常关闭;
|
|
9129
|
-
* - `1001`:
|
|
10123
|
+
* - `1001`: 因页面进入后台、豆包客户端回收连接等原因关闭。
|
|
9130
10124
|
*/
|
|
9131
10125
|
code?: number;
|
|
9132
10126
|
/**
|
|
@@ -9149,7 +10143,7 @@ export declare interface SocketTaskErrorEvent {
|
|
|
9149
10143
|
/**
|
|
9150
10144
|
* 错误信息。
|
|
9151
10145
|
*
|
|
9152
|
-
*
|
|
10146
|
+
* 由前端参数校验、编码过程或豆包客户端返回的失败原因组成,可直接用于日志上报。
|
|
9153
10147
|
*/
|
|
9154
10148
|
errMsg: string;
|
|
9155
10149
|
}
|
|
@@ -9175,13 +10169,13 @@ export declare interface SocketTaskMessageEvent {
|
|
|
9175
10169
|
/**
|
|
9176
10170
|
* 当前消息所属连接使用的协议。
|
|
9177
10171
|
*
|
|
9178
|
-
*
|
|
10172
|
+
* 该字段由豆包客户端返回,部分运行环境可能不提供。
|
|
9179
10173
|
*/
|
|
9180
10174
|
protocolType?: string;
|
|
9181
10175
|
/**
|
|
9182
|
-
*
|
|
10176
|
+
* 豆包客户端使用的 WebSocket 实现类型。
|
|
9183
10177
|
*
|
|
9184
|
-
*
|
|
10178
|
+
* 该字段由豆包客户端返回,部分运行环境可能不提供。
|
|
9185
10179
|
*/
|
|
9186
10180
|
socketType?: string;
|
|
9187
10181
|
}
|
|
@@ -9189,7 +10183,7 @@ export declare interface SocketTaskMessageEvent {
|
|
|
9189
10183
|
/**
|
|
9190
10184
|
* WebSocket 连接成功事件。
|
|
9191
10185
|
*
|
|
9192
|
-
*
|
|
10186
|
+
* 当豆包客户端完成 WebSocket 握手并进入 open 状态后触发。
|
|
9193
10187
|
* 收到该事件后,调用方可以开始通过 {@link SocketTask.send} 发送数据。
|
|
9194
10188
|
*
|
|
9195
10189
|
* @public
|
|
@@ -9205,13 +10199,13 @@ export declare interface SocketTaskOpenEvent {
|
|
|
9205
10199
|
/**
|
|
9206
10200
|
* 当前连接使用的网络传输层协议。
|
|
9207
10201
|
*
|
|
9208
|
-
*
|
|
10202
|
+
* 该字段由豆包客户端返回,部分运行环境可能不提供。
|
|
9209
10203
|
*/
|
|
9210
10204
|
protocolType?: string;
|
|
9211
10205
|
/**
|
|
9212
|
-
*
|
|
10206
|
+
* 豆包客户端使用的 WebSocket 实现类型。
|
|
9213
10207
|
*
|
|
9214
|
-
*
|
|
10208
|
+
* 可能的值由豆包客户端实现决定,例如系统 WebSocket 实现或豆包网络库实现;
|
|
9215
10209
|
* 部分运行环境可能不提供。
|
|
9216
10210
|
*/
|
|
9217
10211
|
socketType?: string;
|
|
@@ -9230,7 +10224,7 @@ export declare interface SocketTaskSendParams {
|
|
|
9230
10224
|
* 需要发送给服务端的数据。
|
|
9231
10225
|
*
|
|
9232
10226
|
* - 传入 `string` 时按文本消息发送;
|
|
9233
|
-
* - 传入 `ArrayBuffer`
|
|
10227
|
+
* - 传入 `ArrayBuffer` 时按二进制消息发送,内部会编码后交给豆包客户端处理。
|
|
9234
10228
|
*
|
|
9235
10229
|
* 建议只在 `onOpen` 回调触发后调用 `send`,此时 `readyState` 通常为 `SocketTask.OPEN`。
|
|
9236
10230
|
*/
|
|
@@ -9251,6 +10245,8 @@ export declare interface SocketTaskSendParams {
|
|
|
9251
10245
|
* @returns 不包含字段的结果对象。
|
|
9252
10246
|
* @since 0.0.25
|
|
9253
10247
|
* @contractStatus verified | 开始监听加速度的入参与成功语义已与 Android、iOS 当前实现对齐
|
|
10248
|
+
* @containerSupport Page | supported
|
|
10249
|
+
* @containerSupport Widget | unsupported
|
|
9254
10250
|
* @platformSupport Android | supported | 支持开始监听加速度
|
|
9255
10251
|
* @platformSupport iOS | supported | 支持开始监听加速度
|
|
9256
10252
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9306,6 +10302,8 @@ export declare interface StartAccelerometerParams {
|
|
|
9306
10302
|
* @since 0.0.25
|
|
9307
10303
|
* @contractStatus conflict | ignoreBluetoothAvailable 仅在 iOS 生效,Android 不消费该参数
|
|
9308
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
|
|
9309
10307
|
* @platformSupport Android | supported | 支持搜索附近的 iBeacon
|
|
9310
10308
|
* @platformSupport iOS | supported | 支持搜索附近的 iBeacon
|
|
9311
10309
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9370,6 +10368,8 @@ export declare interface StartBeaconDiscoveryParams {
|
|
|
9370
10368
|
* @returns 不包含字段的结果对象。
|
|
9371
10369
|
* @since 0.0.25
|
|
9372
10370
|
* @contractStatus verified | 搜索蓝牙设备的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
10371
|
+
* @containerSupport Page | supported
|
|
10372
|
+
* @containerSupport Widget | unsupported
|
|
9373
10373
|
* @platformSupport Android | supported | 支持搜索附近蓝牙设备
|
|
9374
10374
|
* @platformSupport iOS | supported | 支持搜索附近蓝牙设备
|
|
9375
10375
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9439,6 +10439,8 @@ export declare interface StartBluetoothDevicesDiscoveryParams {
|
|
|
9439
10439
|
* @since 0.0.25
|
|
9440
10440
|
* @contractStatus verified | 开始监听罗盘的成功语义已与 Android、iOS 当前实现对齐;双端回调频率策略不同但不影响公开类型
|
|
9441
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
|
|
9442
10444
|
* @platformSupport Android | supported | 支持开始监听罗盘
|
|
9443
10445
|
* @platformSupport iOS | supported | 支持开始监听罗盘
|
|
9444
10446
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9478,6 +10480,8 @@ export declare const startCompass: (params?: {} | undefined) => Promise<object>;
|
|
|
9478
10480
|
* @returns 不包含字段的结果对象。
|
|
9479
10481
|
* @since 0.0.25
|
|
9480
10482
|
* @contractStatus verified | 开始监听设备方向的入参与成功语义已与 Android、iOS 当前实现对齐
|
|
10483
|
+
* @containerSupport Page | supported
|
|
10484
|
+
* @containerSupport Widget | unsupported
|
|
9481
10485
|
* @platformSupport Android | supported | 支持开始监听设备方向变化
|
|
9482
10486
|
* @platformSupport iOS | supported | 支持开始监听设备方向变化
|
|
9483
10487
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9532,6 +10536,8 @@ export declare interface StartDeviceMotionListeningParams {
|
|
|
9532
10536
|
* @returns 不包含字段的结果对象。
|
|
9533
10537
|
* @since 0.0.25
|
|
9534
10538
|
* @contractStatus verified | 开始监听陀螺仪的入参与成功语义已与 Android、iOS 当前实现对齐
|
|
10539
|
+
* @containerSupport Page | supported
|
|
10540
|
+
* @containerSupport Widget | unsupported
|
|
9535
10541
|
* @platformSupport Android | supported | 支持开始监听陀螺仪
|
|
9536
10542
|
* @platformSupport iOS | supported | 支持开始监听陀螺仪
|
|
9537
10543
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9587,6 +10593,8 @@ export declare interface StartGyroscopeParams {
|
|
|
9587
10593
|
* @since 0.0.32
|
|
9588
10594
|
* @contractStatus conflict | iOS 原生参数模型要求 type 必传,与公开可选类型冲突
|
|
9589
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
|
|
9590
10598
|
* @platformSupport Android | supported | 支持启动持续定位
|
|
9591
10599
|
* @platformSupport iOS | supported | 支持启动持续定位
|
|
9592
10600
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9613,14 +10621,14 @@ export declare interface StartGyroscopeParams {
|
|
|
9613
10621
|
* }
|
|
9614
10622
|
* ```
|
|
9615
10623
|
* @errorCode common | 102 | Android,iOS
|
|
9616
|
-
* @errorCode errNo | 103 | feature not support | Android,iOS |
|
|
10624
|
+
* @errorCode errNo | 103 | feature not support | Android,iOS | 当前豆包客户端未提供持续定位能力(location service 不可用) | 请在支持持续定位的豆包版本中调用
|
|
9617
10625
|
* @errorCode errNo | 114 | operation cancelled | Android,iOS | 启动过程中被取消(用户取消授权,或授权返回前已调用 stopLocationUpdate) | 需要时重新调用 startLocationUpdate
|
|
9618
10626
|
* @errorCode errNo | 118 | already exists | Android,iOS | 持续定位已启动,重复调用 startLocationUpdate | 先调用 stopLocationUpdate 再重新启动
|
|
9619
10627
|
* @errorCode errNo | 1700001 | location permission denied | Android,iOS | 用户拒绝应用位置授权或系统定位权限被拒 | 调用 authorize 重新发起授权并在系统设置中开启定位权限后重试
|
|
9620
10628
|
* @errorCode errNo | 1700002 | location network error | Android,iOS | 位置授权过程中发生网络错误 | 检查网络连接后重试
|
|
9621
10629
|
* @errorCode errNo | 104 | invalid parameter | iOS | 位置授权 scope 非法 | 检查应用权限声明中配置的 scope 后重试
|
|
9622
|
-
* @platformNote Android | 用户拒绝授权返回 1700001、取消返回 114、授权网络失败返回 1700002
|
|
9623
|
-
* @platformNote iOS | 用户拒绝授权返回 1700001、取消返回 114、授权网络失败返回 1700002、非法 scope 返回 104
|
|
10630
|
+
* @platformNote Android | 用户拒绝授权返回 1700001、取消返回 114、授权网络失败返回 1700002;当前豆包客户端不支持持续定位时返回 103;其他失败统一返回 102。
|
|
10631
|
+
* @platformNote iOS | 用户拒绝授权返回 1700001、取消返回 114、授权网络失败返回 1700002、非法 scope 返回 104;当前豆包客户端不支持持续定位时返回 103;其他失败统一返回 102。
|
|
9624
10632
|
*
|
|
9625
10633
|
* @public
|
|
9626
10634
|
*/
|
|
@@ -9653,6 +10661,8 @@ export declare interface StartLocationUpdateParams {
|
|
|
9653
10661
|
*
|
|
9654
10662
|
* @since 0.0.25
|
|
9655
10663
|
* @contractStatus verified | 双端均可初始化 Wi-Fi 模块
|
|
10664
|
+
* @containerSupport Page | supported
|
|
10665
|
+
* @containerSupport Widget | unsupported
|
|
9656
10666
|
* @platformSupport Android | supported | 支持初始化 Wi-Fi 模块
|
|
9657
10667
|
* @platformSupport iOS | supported | 支持初始化 Wi-Fi 模块
|
|
9658
10668
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9722,6 +10732,8 @@ export declare interface StatResult {
|
|
|
9722
10732
|
* @returns 不包含字段的结果对象。
|
|
9723
10733
|
* @since 0.0.25
|
|
9724
10734
|
* @contractStatus verified | 停止监听加速度的成功语义已与 Android、iOS 当前实现对齐
|
|
10735
|
+
* @containerSupport Page | supported
|
|
10736
|
+
* @containerSupport Widget | unsupported
|
|
9725
10737
|
* @platformSupport Android | supported | 支持停止监听加速度
|
|
9726
10738
|
* @platformSupport iOS | supported | 支持停止监听加速度
|
|
9727
10739
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9752,6 +10764,8 @@ export declare const stopAccelerometer: (params?: {} | undefined) => Promise<obj
|
|
|
9752
10764
|
* @since 0.0.25
|
|
9753
10765
|
* @contractStatus verified | 停止搜索的成功语义与公开类型一致;双端权限与失败行为不同但不影响公开契约
|
|
9754
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
|
|
9755
10769
|
* @platformSupport Android | supported | 支持停止搜索 iBeacon
|
|
9756
10770
|
* @platformSupport iOS | supported | 支持停止搜索 iBeacon
|
|
9757
10771
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9793,6 +10807,8 @@ export declare const stopBeaconDiscovery: (params?: {} | undefined) => Promise<o
|
|
|
9793
10807
|
* @returns 不包含字段的结果对象。
|
|
9794
10808
|
* @since 0.0.25
|
|
9795
10809
|
* @contractStatus verified | 停止搜索蓝牙设备的入参与返回结构已与 Android、iOS 当前实现对齐
|
|
10810
|
+
* @containerSupport Page | supported
|
|
10811
|
+
* @containerSupport Widget | unsupported
|
|
9796
10812
|
* @platformSupport Android | supported | 支持停止搜索蓝牙设备
|
|
9797
10813
|
* @platformSupport iOS | supported | 支持停止搜索蓝牙设备
|
|
9798
10814
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9824,6 +10840,8 @@ export declare const stopBluetoothDevicesDiscovery: (params?: {} | undefined) =>
|
|
|
9824
10840
|
* @returns 不包含字段的结果对象。
|
|
9825
10841
|
* @since 0.0.25
|
|
9826
10842
|
* @contractStatus verified | 停止监听罗盘的成功语义已与 Android、iOS 当前实现对齐
|
|
10843
|
+
* @containerSupport Page | supported
|
|
10844
|
+
* @containerSupport Widget | unsupported
|
|
9827
10845
|
* @platformSupport Android | supported | 支持停止监听罗盘
|
|
9828
10846
|
* @platformSupport iOS | supported | 支持停止监听罗盘
|
|
9829
10847
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9853,6 +10871,8 @@ export declare const stopCompass: (params?: {} | undefined) => Promise<object>;
|
|
|
9853
10871
|
* @returns 不包含字段的结果对象。
|
|
9854
10872
|
* @since 0.0.25
|
|
9855
10873
|
* @contractStatus verified | 停止监听设备方向的成功语义已与 Android、iOS 当前实现对齐
|
|
10874
|
+
* @containerSupport Page | supported
|
|
10875
|
+
* @containerSupport Widget | unsupported
|
|
9856
10876
|
* @platformSupport Android | supported | 支持停止监听设备方向变化
|
|
9857
10877
|
* @platformSupport iOS | supported | 支持停止监听设备方向变化
|
|
9858
10878
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9882,6 +10902,8 @@ export declare const stopDeviceMotionListening: (params?: {} | undefined) => Pro
|
|
|
9882
10902
|
* @returns 不包含字段的结果对象。
|
|
9883
10903
|
* @since 0.0.25
|
|
9884
10904
|
* @contractStatus verified | 停止监听陀螺仪的成功语义已与 Android、iOS 当前实现对齐
|
|
10905
|
+
* @containerSupport Page | supported
|
|
10906
|
+
* @containerSupport Widget | unsupported
|
|
9885
10907
|
* @platformSupport Android | supported | 支持停止监听陀螺仪
|
|
9886
10908
|
* @platformSupport iOS | supported | 支持停止监听陀螺仪
|
|
9887
10909
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9911,6 +10933,8 @@ export declare const stopGyroscope: (params?: {} | undefined) => Promise<object>
|
|
|
9911
10933
|
* @returns 不包含字段的结果对象。
|
|
9912
10934
|
* @since 0.0.32
|
|
9913
10935
|
* @contractStatus verified | 停止语义与 Android、iOS 当前实现一致,未启动时调用也成功
|
|
10936
|
+
* @containerSupport Page | supported
|
|
10937
|
+
* @containerSupport Widget | unsupported
|
|
9914
10938
|
* @platformSupport Android | supported | 支持停止持续定位
|
|
9915
10939
|
* @platformSupport iOS | supported | 支持停止持续定位
|
|
9916
10940
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -9930,7 +10954,7 @@ export declare const stopGyroscope: (params?: {} | undefined) => Promise<object>
|
|
|
9930
10954
|
* }
|
|
9931
10955
|
* ```
|
|
9932
10956
|
* @errorCode common | 102 | Android,iOS
|
|
9933
|
-
* @errorCode errNo | 103 | feature not support | Android,iOS |
|
|
10957
|
+
* @errorCode errNo | 103 | feature not support | Android,iOS | 当前豆包客户端未提供持续定位能力(location service 不可用),无法停止 | 请在支持持续定位的豆包版本中调用
|
|
9934
10958
|
* @platformNote All | 未启动或仍在授权阶段调用直接返回成功;仅在已启动后停止失败时返回错误码,其他失败统一返回 102。
|
|
9935
10959
|
*
|
|
9936
10960
|
* @public
|
|
@@ -9951,6 +10975,8 @@ export declare function stopLocationUpdate(): Promise<LocationOperationResult>;
|
|
|
9951
10975
|
*
|
|
9952
10976
|
* @since 0.0.25
|
|
9953
10977
|
* @contractStatus verified | 双端均可关闭 Wi-Fi 模块
|
|
10978
|
+
* @containerSupport Page | supported
|
|
10979
|
+
* @containerSupport Widget | unsupported
|
|
9954
10980
|
* @platformSupport Android | supported | 支持关闭 Wi-Fi 模块
|
|
9955
10981
|
* @platformSupport iOS | supported | 支持关闭 Wi-Fi 模块
|
|
9956
10982
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -10116,6 +11142,18 @@ export declare interface ThemeChangeEvent {
|
|
|
10116
11142
|
*/
|
|
10117
11143
|
export declare type ThemeChangeListener = (event: ThemeChangeEvent) => void;
|
|
10118
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
|
+
|
|
10119
11157
|
/**
|
|
10120
11158
|
* {@link FileSystemManager.truncate} 的参数。
|
|
10121
11159
|
*
|
|
@@ -10139,6 +11177,18 @@ export declare interface TruncateParams {
|
|
|
10139
11177
|
|
|
10140
11178
|
declare type TypeGuard<From, To extends From> = (from: From) => from is To;
|
|
10141
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
|
+
|
|
10142
11192
|
/**
|
|
10143
11193
|
* {@link FileSystemManager.unlink} 的参数。
|
|
10144
11194
|
*
|
|
@@ -10193,6 +11243,8 @@ export declare interface UnzipParams {
|
|
|
10193
11243
|
*
|
|
10194
11244
|
* @since 0.0.26
|
|
10195
11245
|
* @contractStatus verified | 公开定义与 Android、iOS 的成功、失败路径一致。
|
|
11246
|
+
* @containerSupport Page | supported
|
|
11247
|
+
* @containerSupport Widget | supported
|
|
10196
11248
|
* @platformSupport Android | supported | 支持向 Agent 捐赠模型上下文。
|
|
10197
11249
|
* @platformSupport iOS | supported | 支持向 Agent 捐赠模型上下文。
|
|
10198
11250
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -10266,6 +11318,8 @@ export declare interface UpdateModelContextParams {
|
|
|
10266
11318
|
*
|
|
10267
11319
|
* @since 0.0.26
|
|
10268
11320
|
* @contractStatus verified | 公开定义与 Android、iOS 的成功、失败路径一致。
|
|
11321
|
+
* @containerSupport Page | supported
|
|
11322
|
+
* @containerSupport Widget | supported
|
|
10269
11323
|
* @platformSupport Android | supported | 支持更新 Widget 卡片实例的渲染数据。
|
|
10270
11324
|
* @platformSupport iOS | supported | 支持更新 Widget 卡片实例的渲染数据。
|
|
10271
11325
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -10282,10 +11336,10 @@ export declare interface UpdateModelContextParams {
|
|
|
10282
11336
|
* }
|
|
10283
11337
|
* ```
|
|
10284
11338
|
* @errorCode common | 102 | Android,iOS
|
|
10285
|
-
* @errorCode errNo | 103 | feature not support | Android,iOS |
|
|
11339
|
+
* @errorCode errNo | 103 | feature not support | Android,iOS | 当前豆包环境未提供消息更新能力 | 请在支持卡片消息更新的豆包环境中调用。
|
|
10286
11340
|
* @errorCode errNo | 104 | invalid parameter | Android,iOS | widgetInstanceId 或 widgetData 为空,或传入了空字符串的 widgetId | 传入非空的 widgetInstanceId、widgetData,并确保 widgetId 有效后重试。
|
|
10287
11341
|
* @errorCode errNo | 116 | resource not found | Android,iOS | 依据 widgetInstanceId 找不到对应消息,或依据 widgetId 找不到已注册的 Widget | 确认 widgetInstanceId 与 widgetId 有效后重试。
|
|
10288
|
-
* @platformNote All | 参数为空返回 104;消息或 Widget 未找到返回 116
|
|
11342
|
+
* @platformNote All | 参数为空返回 104;消息或 Widget 未找到返回 116;当前豆包环境未提供消息更新能力时返回 103;其他失败统一返回 102。
|
|
10289
11343
|
*
|
|
10290
11344
|
* @public
|
|
10291
11345
|
*/
|
|
@@ -10354,6 +11408,8 @@ export declare interface UpdateWidgetParams {
|
|
|
10354
11408
|
*
|
|
10355
11409
|
* @since 0.0.39
|
|
10356
11410
|
* @contractStatus verified | enableProfile 当前仅允许 false,Android、iOS 均支持正常发起上传。
|
|
11411
|
+
* @containerSupport Page | supported
|
|
11412
|
+
* @containerSupport Widget | unsupported
|
|
10357
11413
|
* @platformSupport Android | supported | 支持文件上传、进度监听、响应头监听和中断任务。
|
|
10358
11414
|
* @platformSupport iOS | supported | 支持文件上传、进度监听、响应头监听和中断任务。
|
|
10359
11415
|
* @platformSupport PC | unsupported | 当前未提供该平台实现。
|
|
@@ -10367,7 +11423,7 @@ export declare interface UpdateWidgetParams {
|
|
|
10367
11423
|
* @errorCode errNo | 121902 | uploadFile:fail no file exist | Android,iOS | filePath 为空、文件不存在或路径不是文件 | 使用文件 API 获取当前智能服务可访问的有效文件路径
|
|
10368
11424
|
* @errorCode errNo | 121905 | uploadFile:fail upload file abort | Android,iOS | 调用 UploadTask.abort 中断上传 | 按业务需要处理取消状态,无需自动重试
|
|
10369
11425
|
* @errorCode errNo | 121906 | uploadFile:fail file path permission denied | Android,iOS | 当前智能服务无权访问 filePath | 改用当前智能服务目录内的文件
|
|
10370
|
-
* @errorCode errNo | 121920 | uploadFile:fail request time out | Android,iOS |
|
|
11426
|
+
* @errorCode errNo | 121920 | uploadFile:fail request time out | Android,iOS | 上传超过豆包客户端的超时时间 | 检查网络或设置合理的 timeout 后重试
|
|
10371
11427
|
* @errorCode errNo | 121985 | uploadFile:fail network unavailable | Android,iOS | 当前网络不可用 | 恢复网络连接后重试
|
|
10372
11428
|
* @errorCode errNo | 121991 | uploadFile:fail network error | Android,iOS | 上传过程中发生网络错误 | 检查网络和服务端状态后重试
|
|
10373
11429
|
* @errorCode errNo | 121992 | uploadFile:fail enableProfile is not supported | Android,iOS | enableProfile 设置为 true | 移除 enableProfile 或设置为 false
|
|
@@ -10400,14 +11456,14 @@ export declare function uploadFile(params: UploadFileParams): UploadTask;
|
|
|
10400
11456
|
* @public
|
|
10401
11457
|
*/
|
|
10402
11458
|
export declare interface UploadFileParams {
|
|
10403
|
-
/** 开发者服务器地址,需为完整的 HTTP/HTTPS URL
|
|
11459
|
+
/** 开发者服务器地址,需为完整的 HTTP/HTTPS URL,并通过豆包配置的上传域名白名单校验。 */
|
|
10404
11460
|
url: string;
|
|
10405
11461
|
/** 要上传文件资源的本地路径。 */
|
|
10406
11462
|
filePath: string;
|
|
10407
11463
|
/** 文件对应的 form field name/key,服务端通过该 key 获取文件内容;multipart filename 使用 filePath 的 basename。 */
|
|
10408
11464
|
name: string;
|
|
10409
11465
|
/**
|
|
10410
|
-
* HTTP 请求 Header。`referer`、`user-agent`、`content-type`
|
|
11466
|
+
* HTTP 请求 Header。`referer`、`user-agent`、`content-type` 等由豆包客户端管理的字段不会被业务覆盖。
|
|
10411
11467
|
*
|
|
10412
11468
|
* @default -
|
|
10413
11469
|
*/
|
|
@@ -10419,7 +11475,7 @@ export declare interface UploadFileParams {
|
|
|
10419
11475
|
*/
|
|
10420
11476
|
formData?: Record<string, unknown>;
|
|
10421
11477
|
/**
|
|
10422
|
-
* 超时时间,单位 ms
|
|
11478
|
+
* 超时时间,单位 ms;不传时使用豆包客户端的默认超时配置。
|
|
10423
11479
|
*
|
|
10424
11480
|
* @default -
|
|
10425
11481
|
*/
|
|
@@ -10461,7 +11517,7 @@ export declare interface UploadTask extends Promise<UploadFileResult> {
|
|
|
10461
11517
|
/**
|
|
10462
11518
|
* 监听上传进度变化。
|
|
10463
11519
|
*
|
|
10464
|
-
*
|
|
11520
|
+
* 同一个任务可以注册多个回调,每次收到豆包客户端的进度事件时依次调用。
|
|
10465
11521
|
*/
|
|
10466
11522
|
onProgressUpdate: (callback: (event: UploadTaskProgressUpdateEvent) => void) => void;
|
|
10467
11523
|
/**
|
|
@@ -10473,7 +11529,7 @@ export declare interface UploadTask extends Promise<UploadFileResult> {
|
|
|
10473
11529
|
/**
|
|
10474
11530
|
* 监听 HTTP Response Header 事件。
|
|
10475
11531
|
*
|
|
10476
|
-
*
|
|
11532
|
+
* 同一个任务可以注册多个回调,豆包客户端收到上传响应头时依次调用。
|
|
10477
11533
|
*/
|
|
10478
11534
|
onHeadersReceived: (callback: (event: UploadTaskHeadersReceivedEvent) => void) => void;
|
|
10479
11535
|
/**
|
|
@@ -10561,6 +11617,8 @@ export declare type UserScreenRecordState = 'start' | 'stop';
|
|
|
10561
11617
|
* @since 0.0.25
|
|
10562
11618
|
* @contractStatus conflict | 长震动的成功语义双端不一致
|
|
10563
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
|
|
10564
11622
|
* @platformSupport Android | supported | 支持长震动
|
|
10565
11623
|
* @platformSupport iOS | supported | 支持长震动
|
|
10566
11624
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -10601,6 +11659,8 @@ export declare const vibrateLong: (params?: {} | undefined) => Promise<object>;
|
|
|
10601
11659
|
* @since 0.0.25
|
|
10602
11660
|
* @contractStatus conflict | type 参数在 Android 侧的必填性与 TypeScript 可选声明不一致
|
|
10603
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
|
|
10604
11664
|
* @platformSupport Android | supported | 支持短震动
|
|
10605
11665
|
* @platformSupport iOS | supported | 支持短震动
|
|
10606
11666
|
* @platformSupport PC | unsupported | 暂不支持
|
|
@@ -10746,6 +11806,8 @@ export declare interface WindowSafeArea {
|
|
|
10746
11806
|
* @returns 不包含字段的结果对象。
|
|
10747
11807
|
* @since 0.0.25
|
|
10748
11808
|
* @contractStatus verified | 写入特征值的入参与返回结构已与 Android、iOS 当前实现对齐;value 由框架统一编码为 Base64 传给原生
|
|
11809
|
+
* @containerSupport Page | supported
|
|
11810
|
+
* @containerSupport Widget | unsupported
|
|
10749
11811
|
* @platformSupport Android | supported | 支持写入 BLE 特征值
|
|
10750
11812
|
* @platformSupport iOS | supported | 支持写入 BLE 特征值
|
|
10751
11813
|
* @platformSupport PC | unsupported | 暂不支持
|