@bud-fe/h5-native-bridge 1.0.5 → 1.0.7

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.
@@ -1,11 +1,32 @@
1
1
  import { BridgePlugin, PluginContext, CallbacksBase } from '../core';
2
2
 
3
+ /**
4
+ * 实人认证触发来源枚举
5
+ * @enum {string}
6
+ */
7
+ export declare enum TriggerSource {
8
+ /** 登录场景 */
9
+ LOGIN = "LOGIN",
10
+ /** 每日开门场景 */
11
+ DAILY_OPEN = "DAILY_OPEN",
12
+ /** 晨会场景 */
13
+ MORNING_MEETING = "MORNING_MEETING",
14
+ /** 访客场景 */
15
+ VISIT = "VISIT"
16
+ }
3
17
  export interface AuthenticationResult {
4
18
  photoStatus: number;
5
19
  }
20
+ export interface ExclusiveLiveCheckOptions extends CallbacksBase {
21
+ /**
22
+ * 触发来源(必填),用于区分不同的认证场景
23
+ * @see TriggerSource
24
+ */
25
+ triggerSource: TriggerSource;
26
+ }
6
27
  declare module "../core" {
7
28
  interface PluginMethods {
8
- exclusiveLiveCheck: (options?: CallbacksBase) => Promise<AuthenticationResult>;
29
+ exclusiveLiveCheck: (options: ExclusiveLiveCheckOptions) => Promise<AuthenticationResult>;
9
30
  }
10
31
  interface NativeBridgeCore extends PluginMethods {
11
32
  }
@@ -13,18 +34,19 @@ declare module "../core" {
13
34
  declare class AuthenticationPlugin implements BridgePlugin {
14
35
  private context?;
15
36
  readonly name = "authentication";
16
- readonly version = "1.0.0";
37
+ readonly version = "1.1.0";
17
38
  install(context: PluginContext): void;
18
39
  /**
19
40
  * 执行实人认证
20
- * @param options - 认证选项,包含成功、失败和完成的回调函数
41
+ * @param options - 认证选项,包含触发来源和回调函数
42
+ * @property options.triggerSource - 触发来源(必填),必须是TriggerSource枚举中的值
21
43
  * @property options.success - 认证成功时的回调函数,接收认证结果
22
44
  * @property options.fail - 认证失败时的回调函数,接收错误信息
23
45
  * @property options.complete - 认证完成时的回调函数(无论成功或失败)
24
46
  * @returns Promise<AuthenticationResult> - 返回认证结果的Promise对象
25
- * @throws {BridgeError} - 如果插件未正确初始化,抛出BridgeError异常
47
+ * @throws {BridgeError} - 如果插件未初始化或参数不合法,抛出BridgeError异常
26
48
  */
27
- exclusiveLiveCheck(options?: CallbacksBase): Promise<AuthenticationResult>;
49
+ exclusiveLiveCheck(options: ExclusiveLiveCheckOptions): Promise<AuthenticationResult>;
28
50
  }
29
51
  declare const _default: AuthenticationPlugin;
30
52
  export default _default;
@@ -1,12 +1,13 @@
1
1
  import { BridgePlugin, PluginContext } from '../core';
2
2
 
3
3
  export interface ToastParams {
4
- /** toast的类型 none, success, fail, exception*/
5
- type?: "none" | "success" | "fail" | "exception";
4
+ /** toast的类型 none, success, fail, exception,normal*/
5
+ type?: "none" | "success" | "fail" | "exception" | "normal";
6
6
  /** 提示信息 */
7
7
  content: string;
8
8
  /** 显示持续时间,单位毫秒,默认2000ms,按系统规范[android只有两种(<=2s >2s)] */
9
9
  duration?: number;
10
+ position?: "top" | "bottom" | "center";
10
11
  }
11
12
  export interface LoadingParams {
12
13
  /** 提示信息 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bud-fe/h5-native-bridge",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "H5与原生App通信工具库",
5
5
  "type": "module",
6
6
  "main": "./dist/native-bridge.umd.js",